Unity Camera可在Oculus Gear VR上运行,但不能在Oculus Go上运行

时间:2019-01-19 20:05:45

标签: unity3d oculusgo

我是Unity和Oculus的初学者,但是已经为Oculus Gear VR创建了一个可行的版本。一旦我为Oculus Go进行了构建,相机就会朝下卡住,无法识别我的头部运动。

我尝试了OVRCameraRig的不同示例,即使在构建Oculus Utilities Example场景时,摄像机的结果也相同。

在Oculus博客上,我提到了“相机:Oculus Go没有相机,并且无法运行依赖相机访问的应用程序。”我不明白,Go如何选择视图?

我已经意识到,有时在Mac上工作具有挑战性,但是我认为这与它无关。我尝试了不同的相机预设和不同的构建设置。

    [ClassInfo("This component fires an 'input' ray along its transform forward every frame.")]
    [SerializeField]
    protected string classInfo;

    //-----------------------------------------------------------------------------------------
    // Protected Fields:
    //-----------------------------------------------------------------------------------------

    protected LayerMask exclusionLayers = 0; // Layers to exclude from the raycast.
    protected float rayLength = 20f; // How far into the scene the ray is cast.

    //-----------------------------------------------------------------------------------------
    // Public Properties:
    //-----------------------------------------------------------------------------------------

    public IInputBroadcaster CurrentInteractible { get; private set; }
    public IInputBroadcaster LastInteractible { get; private set; } //The last interactive item

    //-----------------------------------------------------------------------------------------
    // Unity Lifecycle:
    //-----------------------------------------------------------------------------------------

    protected void Start() { StartCoroutine(RaycastLoopCoroutine()); }

    //-----------------------------------------------------------------------------------------
    // Private Methods:
    //-----------------------------------------------------------------------------------------

    private IEnumerator RaycastLoopCoroutine() {
        while (true) {
            yield return new WaitForEndOfFrame();
            PhysicsRaycast();
        }
    }

    private void PhysicsRaycast() {
        // Create a ray that points forwards from the camera.
        Ray ray = new Ray(transform.position, transform.forward);
        RaycastHit hit;

        // Do the raycast forweards to see if we hit an interactive item
        if (Physics.Raycast(ray, out hit, rayLength)) {
            IInputBroadcaster interactible = hit.collider.GetComponentInChildren<IInputBroadcaster>(); //attempt to get the VRInteractiveItem on the hit object
            CurrentInteractible = interactible;

            // If we hit an interactive item and it's not the same as the last interactive item, then call Over
            if (interactible != null && interactible != LastInteractible) interactible.BeginInput();

            // Deactive the last interactive item 
            if (interactible != LastInteractible) DeactiveLastInteractible();

            LastInteractible = interactible;
        }
        else {
            // Nothing was hit, deactive the last interactive item.
            DeactiveLastInteractible();
            CurrentInteractible = null;
        }
    }

    private void DeactiveLastInteractible() {
        if (LastInteractible == null) return;

        LastInteractible.EndInput();
        LastInteractible = null;
    }
}

}

我到处都看过,看不到有人提到这个问题,所以我假设我做错了什么,但无法弄清楚Oculus Gear相机和Oculus Go相机之间的区别。

如果有人可以帮助我,我将不胜感激! 谢谢!

0 个答案:

没有答案