public override void Enable(PlayerMotor callingObject) { Disable(); userCoolingDown = false; PlayerInputManager.GetAxisFromString(InputAxis).onKey += HorizontalPressed; PlayerInputManager.GetAxisFromString(InputLaunch).onKeyDown += LaunchPressed; PlayerInputManager.GetAxisFromString(InputJump).onKeyDown += JumpPressed; userLaunch = false; userJump = false; if (runBefore) { return; } callingObject.ActiveCoroutines.Add(callingObject.StartRoutine(InputSession())); runBefore = true; }
public void Disable() { PlayerInputManager.GetAxisFromString(InputAxis).onKey -= HorizontalPressed; PlayerInputManager.GetAxisFromString(InputLaunch).onKeyDown -= LaunchPressed; PlayerInputManager.GetAxisFromString(InputJump).onKeyDown -= JumpPressed; }