Gaze 凝视模块

SR点击组件

SRGazeInputModule

Created with Raphaël 2.2.0每帧Process通过摄像机获取Ray有Raycast结果则触发GazeProce事件遍历所有凝视绑定按键构建ButtonState触发点击事件执行结束

构建ButtonState

Created with Raphaël 2.2.0开始执行Raycast获取按键状态构建ButtonState构建结束

触发点击事件

按下状态

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

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

ISRVRGazePointerDownHandler 事件会被触发两次,不知道源代码里是不是写错了

释放状态

Created with Raphaël 2.2.0开始获取SRVLCustomEventDate获取Raycast到的GameObject触发Up事件 尝试获取Click事件GameObject获取成功且eligibleForClick为true触发Click事件重置SRVLCustomEventData信息结束yesno

尝试触发的事件依次为
ISRVRGazePointerUpHandler
IPointerUpHandler - UnityEngine.EventSystems.IEventSystemHandler.pointerUpHandler IPointerClickHandler - UnityEngine.EventSystems.IEventSystemHandler.pointerClickHandler
ISRVRGazePointClickHandler

凝视没有空白点击事件