Exemple #1
0
 private ISource <float> GetAxisSource()
 {
     foreach (GamepadAxis axis in Enum.GetValues(typeof(GamepadAxis)))
     {
         if (JoystickAxis.GetAxisValue(axis) > 0.5f)
         {
             return(new JoystickAxis(axis));
         }
     }
     foreach (MouseAxis.Axis axis in Enum.GetValues(typeof(MouseAxis.Axis)))
     {
         if (MouseAxis.GetAxisValue(axis) > 0.5f)
         {
             return(new MouseAxis(axis));
         }
     }
     return(null);
 }
 private static bool OverThreshold(GamepadAxis axis, float threshold)
 {
     return(Mathf.Abs(JoystickAxis.GetAxisValue(axis)) > threshold);
 }