Esempio n. 1
0
        //=========== UPDATING ===========

        /** <summary> Called every step to update the control state. </summary> */
        public void Update(int time, double pressure)
        {
            // Apply the dead zone to the position
            if (pressure <= deadZone)
            {
                pressure = 0.0;
            }

            // Update the control state based on its position
            if (disabledState == DisableState.Enabled)
            {
                this.pressure = pressure;

                // Update the button control
                button.Update(time, pressure > ButtonDeadZone);
            }
            else if (disabledState == DisableState.DisabledUntilRelease)
            {
                if (pressure == 0.0)
                {
                    disabledState = DisableState.Enabled;
                    for (int i = 0; i < 4; i++)
                    {
                        button.Enable();
                    }
                }
            }
        }
Esempio n. 2
0
        public void Initialize()
        {
            inputControl = new InputControl();
            inputControl.Main.SetCallbacks(this);

            inputControl.Enable();
        }
Esempio n. 3
0
 void OnEnable()
 {
     inputControl.Enable();
 }
Esempio n. 4
0
 public void OnEnable()
 {
     _input.Enable();
 }
Esempio n. 5
0
 // void Update(){
 //     accelerator = Input.GetAxis("Vertical");
 //     brake = Input.GetKey(KeyCode.Space);
 //     isLeft = Input.GetKey(KeyCode.A);
 //     isRight = Input.GetKey(KeyCode.D);
 // }
 void OnEnable()
 {
     control.Enable();
 }