/// <summary> /// Update all input /// </summary> void Update() { BasicGazeInfo.previousPosition = BasicGazeInfo.currentPosition; BasicGazeInfo.currentPosition = gazeCursor.transform.localPosition; BasicGazeInfo.delta = BasicGazeInfo.currentPosition - BasicGazeInfo.previousPosition; // Move event if (BasicGazeInfo.delta.sqrMagnitude > Mathf.Epsilon) { if (GazeMoved != null) { GazeMoved(BasicGazeInfo); } } if (UnityEngine.Input.GetButtonDown("Fire1")) { GestureInfo gesture = new GestureInfo { delta = BasicGazeInfo.delta, previousPosition = BasicGazeInfo.previousPosition, currentPosition = BasicGazeInfo.currentPosition }; if (Tapped != null) { Tapped(gesture); } } }
void TapEventHandler(TappedEventArgs tappedEventArgs) { GestureInfo gesture = new GestureInfo { delta = BasicGazeInfo.delta, previousPosition = BasicGazeInfo.previousPosition, currentPosition = BasicGazeInfo.currentPosition }; if (EventSystem.current.isActiveAndEnabled) { Tapped(gesture); } }