public InputDevice(string name) { Name = name; Meta = ""; LastChangeTick = 0; const int numInputControlTypes = (int)InputControlType.Count + 1; Controls = new InputControl[numInputControlTypes]; LeftStickX = new OneAxisInputControl(); LeftStickY = new OneAxisInputControl(); LeftStick = new TwoAxisInputControl(); LeftStick.LowerDeadZone = 0.2f; RightStickX = new OneAxisInputControl(); RightStickY = new OneAxisInputControl(); RightStick = new TwoAxisInputControl(); RightStick.LowerDeadZone = 0.2f; DPadX = new OneAxisInputControl(); DPadY = new OneAxisInputControl(); DPad = new TwoAxisInputControl(); DPad.LowerDeadZone = 0.2f; Command = AddControl(InputControlType.Command, "Command"); }
internal TwoAxisInputControl() { Left = new OneAxisInputControl(); Right = new OneAxisInputControl(); Up = new OneAxisInputControl(); Down = new OneAxisInputControl(); }
public TwoAxisInputControl() { Left = new OneAxisInputControl(); Right = new OneAxisInputControl(); Up = new OneAxisInputControl(); Down = new OneAxisInputControl(); }
public InputDevice( string name ) { Name = name; Meta = ""; LastChangeTick = 0; const int numInputControlTypes = (int) InputControlType.Count + 1; Controls = new InputControl[numInputControlTypes]; LeftStickX = new OneAxisInputControl(); LeftStickY = new OneAxisInputControl(); LeftStick = new TwoAxisInputControl(); LeftStick.LowerDeadZone = 0.2f; RightStickX = new OneAxisInputControl(); RightStickY = new OneAxisInputControl(); RightStick = new TwoAxisInputControl(); RightStick.LowerDeadZone = 0.2f; DPadX = new OneAxisInputControl(); DPadY = new OneAxisInputControl(); DPad = new TwoAxisInputControl(); DPad.LowerDeadZone = 0.2f; Command = AddControl( InputControlType.Command, "Command" ); }
internal void UpdateWithAxes(OneAxisInputControl horizontalAxis, OneAxisInputControl verticalAxis, ulong updateTick, float deltaTime) { LowerDeadZone = Mathf.Max(horizontalAxis.LowerDeadZone, verticalAxis.LowerDeadZone); UpperDeadZone = Mathf.Min(horizontalAxis.UpperDeadZone, verticalAxis.UpperDeadZone); Raw = horizontalAxis.Raw || verticalAxis.Raw; UpdateWithAxes(horizontalAxis.RawValue, verticalAxis.RawValue, updateTick, deltaTime); }
internal void UpdateWithAxes( OneAxisInputControl horizontalAxis, OneAxisInputControl verticalAxis, ulong updateTick, float deltaTime ) { LowerDeadZone = Mathf.Max( horizontalAxis.LowerDeadZone, verticalAxis.LowerDeadZone ); UpperDeadZone = Mathf.Min( horizontalAxis.UpperDeadZone, verticalAxis.UpperDeadZone ); Raw = horizontalAxis.Raw || verticalAxis.Raw; UpdateWithAxes( horizontalAxis.RawValue, verticalAxis.RawValue, updateTick, deltaTime ); }