小编Joh*_*han的帖子

如何从Oculus遥控器获取输入?

我试图弄清楚如何在Unity3D 5.3.4f中使用oculus遥控器。我已经找到了一些 有关OVR映射的文档,但似乎无法弄清楚。

我要实现的是单击中间按钮(Button.One)。

我现在使用的是这一行代码

if (OVRInput.GetUp(OVRInput.Button.One))
    {
        Debug.Log("remote click");
    }
Run Code Online (Sandbox Code Playgroud)

但是,当我运行该应用程序时,出现此错误。

NullReferenceException:对象引用未设置为对象OVRInput.GetUp(按钮virtualMask,控制器controllerMask)的实例(在Assets / OVR / Scripts / OVRInput.cs:600上)menuButtonHandler.Update()(在Assets / menuButtonHandler.cs:136上) )

可以在此脚本中找到

/// <summary>
/// Gets the current up state of the given virtual button mask with the given controller mask.
/// Returns true if any masked button was released this frame on any masked controller and no other masked button is still down this frame.
/// </summary>
public static bool GetUp(Button virtualMask, Controller controllerMask = Controller.Active) …
Run Code Online (Sandbox Code Playgroud)

c# unity-game-engine oculus

5
推荐指数
1
解决办法
6741
查看次数

标签 统计

c# ×1

oculus ×1

unity-game-engine ×1