unity3d:htcvive禁止头显定位,但不限制角度

2023-08-24 14:52:06 浏览数 (1)

过山车,导游模式,或者推动玩家前进,禁止玩家移动,但是不限制观察角度

代码语言:javascript复制
using System.Collections;
using UnityEngine;
using UnityEngine.XR;

public class BanPos : MonoBehaviour {

	// Use this for initialization
	void Start () {

        StartCoroutine(YieldBan());  
    }


    IEnumerator YieldBan()
    {
        yield return new WaitForSeconds(1.0f);
        InputTracking.disablePositionalTracking = true;
    }
}

0 人点赞