VR Collider 模块

SR点击组件

SRVRColliderInputModule

基本流程

OnTriggerEnter 增加目标到交互缓存队列末尾
OnTriggerExit 交互缓存队列中移除目标
在HandlePointerExitAndEnter中设置Trigger检测缓存, 以供Ray检测使用

Created with Raphaël 2.2.0每帧Process构建ButtonState触发点击事件执行结束

构建ButtonState

Created with Raphaël 2.2.0开始获取手柄在屏幕上的位置获取位移和旋转delta获取Raycast结果获取按键状态构建ButtonState构建结束

触发点击事件

获取接收事件的GameObject

Created with Raphaël 2.2.0开始获取交互缓存队列中tag为GeneralAbility12GeneralAbility13GeneralAbility14的GameObject否则返回队列第一个元素triggerObject获取Raycast到的GameObjecttriggerObject不为空且不为Raycast到GameObject父级使用triggerObject使用Raycast到的GameObjectyesno

按下状态

Created with Raphaël 2.2.0开始获取SRVLCustomEventDate获取接收事件的GameObjectGameObject上有无注册事件或事件包含Trigger类型填充buttonData数据eligibleForClick赋值为true触发Down事件更新点击次数结束yesno

触发的Down事件依次为
ISRVRTriggerPointerDownHandler
IPointerDownHandler - UnityEngine.EventSystems.IEventSystemHandler.pointerDownHandler
最终尝试获取IPointerClickHandler
若其中过程有有返回GameObject, 代表执行成功, 则不继续执行后续事件

释放状态

Created with Raphaël 2.2.0开始获取SRVLCustomEventDate获取接收事件的GameObject触发Up事件 尝试获取Click事件GameObject获取成功且eligibleForClick为true触发Click事件射线投射到的GameObject为空触发空白射线点击事件重置SRVLCustomEventData信息结束yesnoyesno

尝试触发的事件依次为
ISRVRTriggerPointerUpHandler
IPointerUpHandler - UnityEngine.EventSystems.IEventSystemHandler.pointerUpHandler IPointerClickHandler - UnityEngine.EventSystems.IEventSystemHandler.pointerClickHandler
ISRVRPointerClickHandler
ISRVRPointerClickBlankHandler