【Quest开发】控制器输入映射
https://developers.meta.com/horizon/documentation/unity/unity-ovrinput/
搬一下省得每次都找不到
组合控制器的虚拟映射

单独控制器的虚拟映射

原始映射

官方提倡使用虚拟映射,下面是一个比较常见的使用方法
This can be taken a step further to allow the same code to be used for either hand by specifying the controller in a variable that is set externally, such as on a public variable in Unity Editor.
可以更进一步,通过在外部设置的变量中指定控制器(例如 Unity Editor 中的公共变量),允许将相同的代码用于任一只手。Example Usage: 示例用法:// public variable that can be set to LTouch or RTouch in the Unity Inspector public Controller controller;// returns a float of the hand trigger’s current state on the controller // specified by the controller variable. OVRInput.Get(OVRInput.Axis1D.PrimaryHandTrigger, controller);// returns true if the primary button (“A” or “X”) is pressed on the controller // specified by the controller variable. OVRInput.Get(OVRInput.Button.One, controller);This is convenient since it avoids the common pattern of if/else checks for left or right hand input mappings.
这很方便,因为它避免了对左手或右手输入映射进行 if/else 检查的常见模式
meta给的这个示例把类名省了用不了...得这样写
public OVRInput.Controller controller;axis = OVRInput.Get(OVRInput.Axis1D.PrimaryHandTrigger, controller);
常用控件集

常用函数

