Ejemplo n.º 1
0
        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");
        }
Ejemplo n.º 2
0
 internal TwoAxisInputControl()
 {
     Left  = new OneAxisInputControl();
     Right = new OneAxisInputControl();
     Up    = new OneAxisInputControl();
     Down  = new OneAxisInputControl();
 }
Ejemplo n.º 3
0
 public TwoAxisInputControl()
 {
     Left  = new OneAxisInputControl();
     Right = new OneAxisInputControl();
     Up    = new OneAxisInputControl();
     Down  = new OneAxisInputControl();
 }
Ejemplo n.º 4
0
		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" );
		}
Ejemplo n.º 5
0
		public TwoAxisInputControl()
		{
			Left = new OneAxisInputControl();
			Right = new OneAxisInputControl();
			Up = new OneAxisInputControl();
			Down = new OneAxisInputControl();
		}
Ejemplo n.º 6
0
 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);
 }
Ejemplo n.º 7
0
		internal TwoAxisInputControl()
		{
			Left = new OneAxisInputControl();
			Right = new OneAxisInputControl();
			Up = new OneAxisInputControl();
			Down = new OneAxisInputControl();
		}
Ejemplo n.º 8
0
		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 );
		}