//=========== 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(); } } } }
public void Initialize() { inputControl = new InputControl(); inputControl.Main.SetCallbacks(this); inputControl.Enable(); }
void OnEnable() { inputControl.Enable(); }
public void OnEnable() { _input.Enable(); }
// 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(); }