Пример #1
0
 static Vector2 Direction(InputDevice device,
                          IEnumerable <InputTarget> targetsX,
                          IEnumerable <InputTarget> targetsY)
 {
     if (device == null)
     {
         return(new Vector2());
     }
     return(new Vector2 {
         x = device.GetControls(targetsX).Average(Val),
         y = device.GetControls(targetsY).Average(Val)
     });
 }
Пример #2
0
 static bool Check(InputDevice device, IEnumerable <InputTarget> targets)
 {
     return(device != null && device.GetControls(targets).Any(Pressed));
 }