private void OnDirectionUnpress(ActionsController.DirectionActionsPress ev)
        {
            if (!IsValidHand(ev.hand))
            {
                return;
            }

            if (joyHatMap.ContainsKey(ev.button))
            {
                uint hatNumber = joyHatMap[ev.button];
                ReleaseHatDirection(hatNumber);
            }
        }
Пример #2
0
        private void OnDirectionUnpress(ActionsController.DirectionActionsPress ev)
        {
            // if (!IsValidHand(ev.hand)) return;
            Debug.Log("Hand " + ev.hand.ToString() + " OnDirectionUnpress " + ev.button.ToString());

            if (joyHatMap.ContainsKey(ev.button))
            {
                var button_id = (int)ev.button;
                if (ev.hand == Hand.Left)
                {
                    button_id += 2;
                }
                uint hatNumber = joyHatMap[(DirectionAction)button_id];
                ReleaseHatDirection(hatNumber);
            }
        }
 private void OnDirectionUnpress(ActionsController.DirectionActionsPress ev)
 {
     if (grabbedHand == Hand.Unknown)
     {
         return;                              // not grabbing
     }
     if (grabbedHand != ev.hand)
     {
         return;                         // wrong hand
     }
     if (joyHatMap.ContainsKey(ev.button))
     {
         uint hatNumber = joyHatMap[ev.button];
         if (output)
         {
             output.SetHatDirection(hatNumber, HatDirection.Neutral);
         }
     }
 }
Пример #4
0
 private void OnDirectionPress(ActionsController.DirectionActionsPress ev)
 {
     NavigateDirection(ev.direction);
 }