c# - 将 Oculus Unity Integration 升级到 v12 后,传送无法在 Quest 上运行

标签 c# unity-game-engine oculus oculusquest oculus-runtime

我当前的堆栈:

  • 耳机:Oculus Quest
  • Unity:v2019.2.19f1
  • Oculus 集成:v12
  • 操作系统:MacOs Catilina

我遵循了有关传送的基本教程,并且效果很好:我能够使用左拇指操纵杆来定义头像传送的新目标和方向。但是,将 Oculus Integration for Unity 更新到最新版本 (v12) 后,它停止工作。

这是我的 LocalPlayerController 预制件的结构:

enter image description here

这是 LocomotionController 对象之前的(工作)配置:

enter image description here

更新后,我注意到 2 个脚本发生了变化:LocomotionController.csTeleportInputHandlerAvatarTouch.cs:

enter image description here

LocomotionController.cs

如果我们更详细地分析此脚本,我们可以注意到两个字段(CharacterControllerPlayerController)的类型已更改。

/************************************************************************************

See SampleFramework license.txt for license terms.  Unless required by applicable law 
or agreed to in writing, the sample code is provided “AS IS” WITHOUT WARRANTIES OR 
CONDITIONS OF ANY KIND, either express or implied.  See the license for specific 
language governing permissions and limitations under the license.

************************************************************************************/

using System;
using UnityEngine;
using System.Collections;
using JetBrains.Annotations;
using UnityEngine.Assertions;
#if UNITY_EDITOR
using UnityEngine.SceneManagement;
#endif

/// <summary>
/// Simply aggregates accessors.
/// </summary>
public class LocomotionController : MonoBehaviour
{
    public OVRCameraRig CameraRig;
    //public CharacterController CharacterController;
    public CapsuleCollider CharacterController;
    //public OVRPlayerController PlayerController;
    public SimpleCapsuleWithStickMovement PlayerController;

    void Start()
    {
        /*
        if (CharacterController == null)
        {
            CharacterController = GetComponentInParent<CharacterController>();
        }
        Assert.IsNotNull(CharacterController);
        */
        //if (PlayerController == null)
        //{
            //PlayerController = GetComponentInParent<OVRPlayerController>();
        //}
        //Assert.IsNotNull(PlayerController);
        if(CameraRig == null)
        {
            CameraRig = FindObjectOfType<OVRCameraRig>();
        }
        Assert.IsNotNull(CameraRig);
#if UNITY_EDITOR
        OVRPlugin.SendEvent("locomotion_controller", (SceneManager.GetActiveScene().name == "Locomotion").ToString(), "sample_framework");
#endif
    }
}

过去,我只需将 LocalPlayerController 预制件拖动到统一编辑器字段中即可设置这些字段,但现在这是不可能的。不确定应该在哪里选择 CapsuleColliderSimpleCapsuleWithStickMovement。如果我触摸左摇杆,我的玩家就会移动,这不是预期的行为,我不知道如何更改它。

TeleportInputHandlerAvatarTouch.cs

这个脚本只是添加了两个新字段(我猜是为了新的手部跟踪系统),但我认为它不会对当前配置造成问题。

我完全陷入困境,不知道如何从这里继续。上次升级似乎没有更新其他脚本,我所有的研究都没有成功。

最佳答案

研究让我得出this reddit post感叹同样的问题,但在他们的例子中,他们似乎只是向 PlayerController 添加了两个组件:CapsuleCollider 和 SimpleCapsuleWithStickMovement。如果您搜索要添加到 PlayerController 的组件,则两者都应该显示在您当前的项目中。然后,您显然可以简单地禁用这些组件,并且您的游戏应该可以玩而不会抛出错误,尽管该行为是否是您想要的则是另一个问题。

关于c# - 将 Oculus Unity Integration 升级到 v12 后,传送无法在 Quest 上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59939850/

相关文章:

c# - 使用 SubList<T> 性能更新 List<T>(LINQ 或 Not)

audio - oculus 音频 sdk 和统一原生空间声音有什么区别?

unity3d - unity - oculus quest - 如何读取拇指输入

adb - 是否可以从应用程序复制/粘贴/键入(例如密码)到 Oculus Quest 耳机中?

c# - 我应该如何在开源项目中包含外部库?

c# - System.Byte[*] 类型是什么意思,我可以在不复制的情况下将它转换为 byte[] 吗?

c# - 检查变量何时等于另一个值的更好方法

android - 如何从基于 Unity 的应用程序获取数据到第三方 Android 应用程序?

android - 使用 Unity 5.4 和 gvr sdk 将普通的 android 应用程序更改为 vr 应用程序

c# - 单击标题时扩展器不展开