Unity获取NoloVR手柄
这里对NoloVR的手柄获取进行了搬移记录,来自官方文档;
记得去官方去下载插件导入哦;不然没有NoloVR类;
https://www.nolovr.com/003_3_1?treeidp=003&treeid=303
public class Input_Test : MonoBehaviour {void Update () {//右手手柄#region right //右手手柄 TouchPad键按下if (NoloVR_Controller.GetDevice(NoloDeviceType.RightController).GetNoloButtonDown(NoloButtonID.TouchPad)){Debug.Log("RightController TouchPad Down");}//右手手柄 TouchPad键按压中if (NoloVR_Controller.GetDevice(NoloDeviceType.RightController).GetNoloButtonPressed(NoloButtonID.TouchPad)){Debug.Log("RightController TouchPad Pressed");}//右手手柄 TouchPad键抬起if (NoloVR_Controller.GetDevice(NoloDeviceType.RightController).GetNoloButtonUp(NoloButtonID.TouchPad)){Debug.Log("RightController TouchPad Up");}//右手手柄 Trigger键按下if (NoloVR_Controller.GetDevice(NoloDeviceType.RightController).GetNoloButtonDown(NoloButtonID.Trigger)){Debug.Log("RightController Trigger Down");}//右手手柄 Trigger键按压中if (NoloVR_Controller.GetDevice(NoloDeviceType.RightController).GetNoloButtonPressed(NoloButtonID.Trigger)){Debug.Log("RightController Trigger Pressed");NoloVR_Controller.GetDevice(NoloDeviceType.RightController).TriggerHapticPulse(100);}//右手手柄 TouchPad键抬起if (NoloVR_Controller.GetDevice(NoloDeviceType.RightController).GetNoloButtonUp(NoloButtonID.Trigger)){Debug.Log("RightController Trigger Up");}//右手手柄 System键按下if (NoloVR_Controller.GetDevice(NoloDeviceType.RightController).GetNoloButtonDown(NoloButtonID.System)){Debug.Log("RightController System Down");}//右手手柄 System键按压中if (NoloVR_Controller.GetDevice(NoloDeviceType.RightController).GetNoloButtonPressed(NoloButtonID.System)){Debug.Log("RightController System Pressed");}//右手手柄 System键抬起if (NoloVR_Controller.GetDevice(NoloDeviceType.RightController).GetNoloButtonUp(NoloButtonID.System)){Debug.Log("RightController System Up");}//右手手柄 Menu键按下if (NoloVR_Controller.GetDevice(NoloDeviceType.RightController).GetNoloButtonDown(NoloButtonID.Menu)){Debug.Log("RightController Menu Down");}//右手手柄 Menu键按压中if (NoloVR_Controller.GetDevice(NoloDeviceType.RightController).GetNoloButtonPressed(NoloButtonID.Menu)){Debug.Log("RightController Menu Pressed");}//右手手柄 Menu键抬起if (NoloVR_Controller.GetDevice(NoloDeviceType.RightController).GetNoloButtonUp(NoloButtonID.Menu)){Debug.Log("RightController Menu Up");}//右手手柄 Grip键按下if (NoloVR_Controller.GetDevice(NoloDeviceType.RightController).GetNoloButtonDown(NoloButtonID.Grip)){Debug.Log("RightController Grip Down");}//右手手柄 Grip键按压中if (NoloVR_Controller.GetDevice(NoloDeviceType.RightController).GetNoloButtonPressed(NoloButtonID.Grip)){Debug.Log("RightController Grip Pressed");}//右手手柄 Grip键抬起if (NoloVR_Controller.GetDevice(NoloDeviceType.RightController).GetNoloButtonUp(NoloButtonID.Grip)){Debug.Log("RightController Grip Up");}//获取右手手柄Grip面板坐标 vector2类型if (NoloVR_Controller.GetDevice(NoloDeviceType.RightController).GetNoloTouchPressed(NoloTouchID.TouchPad)){Debug.Log(NoloVR_Controller.GetDevice(NoloDeviceType.RightController).GetAxis());}#endregion//左手同上不在说明#region leftif (NoloVR_Controller.GetDevice(NoloDeviceType.LeftController).GetNoloButtonDown(NoloButtonID.TouchPad)){Debug.Log("LeftController TouchPad Down");}if (NoloVR_Controller.GetDevice(NoloDeviceType.LeftController).GetNoloButtonPressed(NoloButtonID.TouchPad)){Debug.Log("LeftController TouchPad Pressed");}if (NoloVR_Controller.GetDevice(NoloDeviceType.LeftController).GetNoloButtonUp(NoloButtonID.TouchPad)){Debug.Log("LeftController TouchPad Up");}if (NoloVR_Controller.GetDevice(NoloDeviceType.LeftController).GetNoloButtonDown(NoloButtonID.Trigger)){Debug.Log("LeftController Trigger Down");}if (NoloVR_Controller.GetDevice(NoloDeviceType.LeftController).GetNoloButtonPressed(NoloButtonID.Trigger)){NoloVR_Controller.GetDevice(NoloDeviceType.LeftController).TriggerHapticPulse(100);Debug.Log("LeftController Trigger Pressed");}if (NoloVR_Controller.GetDevice(NoloDeviceType.LeftController).GetNoloButtonUp(NoloButtonID.Trigger)){Debug.Log("LeftController Trigger Up");}if (NoloVR_Controller.GetDevice(NoloDeviceType.LeftController).GetNoloButtonDown(NoloButtonID.System)){Debug.Log("LeftController System Down");}if (NoloVR_Controller.GetDevice(NoloDeviceType.LeftController).GetNoloButtonPressed(NoloButtonID.System)){Debug.Log("LeftController System Pressed");}if (NoloVR_Controller.GetDevice(NoloDeviceType.LeftController).GetNoloButtonUp(NoloButtonID.System)){Debug.Log("LeftController System Up");}if (NoloVR_Controller.GetDevice(NoloDeviceType.LeftController).GetNoloButtonDown(NoloButtonID.Menu)){Debug.Log("LeftController Menu Down");}if (NoloVR_Controller.GetDevice(NoloDeviceType.LeftController).GetNoloButtonPressed(NoloButtonID.Menu)){Debug.Log("LeftController Menu Pressed");}if (NoloVR_Controller.GetDevice(NoloDeviceType.LeftController).GetNoloButtonUp(NoloButtonID.Menu)){Debug.Log("LeftController Menu Up");}if (NoloVR_Controller.GetDevice(NoloDeviceType.LeftController).GetNoloButtonDown(NoloButtonID.Grip)){Debug.Log("LeftController Grip Down");}if (NoloVR_Controller.GetDevice(NoloDeviceType.LeftController).GetNoloButtonPressed(NoloButtonID.Grip)){Debug.Log("LeftController Grip Pressed");}if (NoloVR_Controller.GetDevice(NoloDeviceType.LeftController).GetNoloButtonUp(NoloButtonID.Grip)){Debug.Log("LeftController Grip Up");}if (NoloVR_Controller.GetDevice(NoloDeviceType.LeftController).GetNoloTouchPressed(NoloTouchID.TouchPad)){Debug.Log(NoloVR_Controller.GetDevice(NoloDeviceType.LeftController).GetAxis());}#endregion}
}
Unity获取NoloVR手柄相关推荐
- Unity Input的手柄映射
这段时间在用Unity做用手柄操作的游戏,其中有几个按键有点不解,于是查了一些资料,现在总结出来分享一下 首先这里有张映射图 下面是几个例子,比如我要在input里面设置按A键,就新增一个input映 ...
- 转载 雨松mono Unity获取游戏对象详解(来自我的长微博)
Unity获取游戏对象详解(来自我的长微博) 转载 自 雨松mono 本文固定链接: http://www.xuanyusong.com/archives/2768 转载请注明: 雨松MOMO 201 ...
- unity基础开发----Unity获取PC,Ios系统的mac地址等信息
在软件开发中可以会用到mac地址作为,设备的唯一标示,我们也可以通过unity获取,经测试pc,ios都可以但是安卓没有获取到. 代码如下: using UnityEngine; using Syst ...
- 自用备份 Unity 获取 两个点的中心点
/// <summary>/// 获取两点之间距离一定百分比的一个点/// </summary>/// <param name="start"> ...
- Unity获取包名,产品名,版本号等
Unity获取包名,产品名,版本号等 string PackageName = Application.identifier; //包名string APPversion = Application. ...
- Unity获取隐藏的游戏对象
我觉得Unity里面的Transform 和 GameObject就像两个双胞胎兄弟一样,这俩哥们很要好,我能直接找到你,你也能直接找到我.我看很多人喜欢在类里面去保存GameObject对象.解决G ...
- Unity获取Android手机的RAM和剩余RAM和ROM
Unity获取Android手机的RAM和剩余RAM和ROM 前言 一.Android工程方法的实现 二.生成aar 三.Untiy中的调用 前言 项目工作需要,在游戏APP运行时,获取当前手机的剩余 ...
- unity获取手机IMEI码
1.Android小白的体会:unity获取Android手机的IMEI码 在AndroidStudio中的撸代码,如下: /*** 获取手机IMEI(需要"android.permissi ...
- Unity获取物体下的子物体
Unity获取当前物体的所有子物体 (一)通过使用GetComponentsInChildren() 我们首先先创建一个脚本,在其中Start()方法中添加如下代码 void Start () {Tr ...
最新文章
- 如何防止我的模型过拟合?这篇文章给出了6大必备方法
- 矩阵y=wx+b 位置
- GO语言struct语法
- jvm系列(十):如何优化Java GC「译」
- ERP兵法——从案例透视方法(实施篇下)
- C语言实现红黑树(附完整源码)
- php如何修改xml中element值,php修改xml节点的值
- c++ STL deque容器成员函数
- 最“好”的编程语言 PHP 真的无药可救了吗?
- java设计模式在java中的应用
- eclipse中如何搜索带\的字串
- 计算机视觉论文-2021-07-27
- 魔兽世界暴雪隐藏密集
- 安卓毕业设计源码基于Uniapp+SSM实现的校园心理健康APP
- 叒一次算法作业hhhhhhhh
- 使用CenterNet训练自己的数据集
- 油气田工业控制系统现状
- 关闭弹出的WPS广告提示
- oracle 表在线重建,大表在线重建索引的考虑和碰到的限制问题-ORA-1450
- 3.docker创建容器 (docker容器命令)