public override void Simulate() { _rollbackTimer.Simulate(); if (_rollbackTimer.ShouldExecute()) { gameObject.SetActive(false); } }
public override void Simulate() { _asteroidSpawnRate.Simulate(); if (_asteroidSpawnRate.ShouldExecute()) { CreateAsteroid(); _asteroidSpawnRate.Reset(); } }
public override void Simulate() { if (_playerId == -1) { return; } Vector2 newDirection; newDirection.x = RollbackManager.rbInputManager.GetAxis(RollbackInputManager.AxisEnum.HORIZONTAL, _playerId); newDirection.y = RollbackManager.rbInputManager.GetAxis(RollbackInputManager.AxisEnum.VERTICAL, _playerId); _playerMovement.SetDirection(newDirection); _rollbackTimerBetweenShoots.Simulate(); if (_rollbackTimerBetweenShoots.ShouldExecute()) { if (RollbackManager.rbInputManager.GetInputDown((int)CustomInputManager.ActionsCode.SHOOT, _playerId)) { ProjectileManager.Instance.poolManager.CreateObject(_shootPosition.position, _playerMovement.spriteTransform.rotation, _projectileSpeed); _rollbackTimerBetweenShoots.Reset(); } } }