<VRTK学习二>vrtk ControllerEvent

vrtk_ControllerEvent是vrtk中处理控制器相关消息的脚本。

其中所包括的事件如下,在此脚本中定义了枚举ButtonAlias

public enum ButtonAlias - Button types

  • Undefined - 没有指定的按钮
  • TriggerHairline - 当触发器扳过最小的阈值。
  • TriggerTouch - 当触发器被少量半.
  • TriggerPress - 当触发器被扮了一半.
  • TriggerClick - 触发器完全被扮过来.
  • GripHairline - 当grip按钮被按下一点点.
  • GripTouch - The grip 按钮被接触到.
  • GripPress - The grip 按钮被按下.
  • GripClick - The grip button 完全按下.
  • TouchpadTouch - 触摸板被触摸(没有被按下).
  • TouchpadPress - 触摸板被按下to the point of hearing a click).
  • ButtonOneTouch - The button one is touched.
  • ButtonOnePress - The button one is pressed.
  • ButtonTwoTouch - The button one is touched.
  • ButtonTwoPress - The button one is pressed.
  • StartMenuPress - The button one is pressed.


要使用这个脚本来响应控制器的时间还需要在添加此脚本的游戏对象上添加一个监听脚本。

添加了controllerEvent脚本后,可以看到insepctor面板上的这些参数。




  • Axis Fidelity:按键按下的程度,完全按下是1,松开是0.目前 T任何大于二的结果会给出过于敏感的结果he amount of fidelity in the changes on the axis, which is defaulted to 1. Any number higher than 2 will probably give too sensitive results.
  • Trigger Click Threshold:扳机触发的最小值。 The level on the trigger axis to reach before a click is registered.
  • Trigger Force Zero Threshold:班级停止处罚的最小值 The level on the trigger axis to reach before the axis is forced to 0f.
  • Trigger Axis Zero On Untouch: If this is checked then the trigger axis will be forced to 0f when the trigger button reports an untouch event.
  • Grip Click Threshold: grip按钮点击的阈值The level on the grip axis to reach before a click is registered.
  • Grip Force Zero Threshold:按钮停止出发的阈值 The level on the grip axis to reach before the axis is forced to 0f.
  • Grip Axis Zero On Untouch: If this is checked then the grip axis will be forced to 0f when the grip button reports an untouch event.


添加VRTK_ControllerEvent_UnityEvents组件到VRTK_ControllerEvent物体上可以对unityevent进行访问。

所有的委托事件被映射到unityEvent中加前缀On的。


  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值