Ejemplo n.º 1
0
        public Point GetStickPoint(InputStick Stick)
        {
            if (device != null && device.IsConnected)
            {
                var state = device.GetState();
                switch (Stick)
                {
                    case InputStick.Left:
                        return new Point()
                        {
                            X = state.Gamepad.LeftThumbX - 128,
                            Y = state.Gamepad.LeftThumbY - 128
                        };

                    case InputStick.Right:
                        return new Point()
                        {
                            X = (state.Gamepad.RightThumbX / 256),
                            Y = (-state.Gamepad.RightThumbY / 256)
                        };
                }
            }

            return new Point(0, 0);
        }
Ejemplo n.º 2
0
 public BaseInput()
 {
     FireButton = new InputButton("Fire", RewiredConsts.Action.Fire);
     //BoostButton = new InputButton("Boost", RewiredConsts.Action.Boost);
     ButtonList = new List <InputButton>();
     ButtonList.Add(FireButton);
     ButtonList.Add(BoostButton);
     LeftStick  = new InputStick();
     RightStick = new InputStick();
 }