public void OnUpdate(UpdateEvent e, UnpausedUserNode user, [JoinByUser] ActiveTankNode tank, [JoinByTank] WeaponNode weaponNode) { if (InputManager.GetActionKeyDown(BattleActions.PAUSE) && (this.IsNearZero(weaponNode.weaponRotationControl.Control) && (this.IsNearZero(tank.chassis.MoveAxis) && this.IsNearZero(tank.chassis.TurnAxis)))) { this.EnterPause(user.Entity); } }
public void OnApplicationFocusLost(ApplicationFocusEvent e, UnpausedUserNode user, [JoinByUser] ActiveTankNode tank) { if (!e.IsFocused && this.ShouldPauseOnFocusLoss()) { this.EnterPause(user.Entity); } }