Esempio n. 1
0
 void Update()
 {
     if (Input.GetKeyUp(KeyCode.UpArrow))
     {
         OnIndexDeltaUpdated?.Invoke(-1);
     }
     else if (Input.GetKeyUp(KeyCode.DownArrow))
     {
         OnIndexDeltaUpdated?.Invoke(1);
     }
     else if (Input.GetKeyUp(KeyCode.Space))
     {
         OnDecisionIntended?.Invoke();
     }
 }
        public MLListInputHandler()
        {
            MLInput.OnControllerTouchpadGestureEnd += (b, gesture) =>
            {
                if (gesture.Type == MLInputControllerTouchpadGestureType.Swipe)
                {
                    int delta = SwipeDirectionToIndexDelta(gesture.Direction);
                    OnIndexDeltaUpdated?.Invoke(delta);
                }
            };

            MLInput.OnTriggerUp += (b, f) =>
            {
                OnDecisionIntended?.Invoke();
            };
        }