public override void Update(float deltaTime) { if (_agent == null || _state == State.Dead) { return; } _timeInState += deltaTime; switch (_state) { case State.Idle: UpdateIdle(deltaTime); break; case State.Pathfinding: UpdatePathfinding(deltaTime); break; case State.AvoidingObstacle: UpdateAvoidingObstacle(deltaTime); break; } UpdateTurret(deltaTime); _agent.SetDesiredDirection(_direction); _agent.SetDesiredFacing(_facing); _agent.SetDesiredSpeed(_speed * GameConfig.ENEMY_TANK_SPEED); }
public override void Update(float deltaTime) { if (_agent == null) { return; } _agent.SetDesiredDirection(_moving); _agent.SetDesiredFacing(_facing); _agent.SetDesiredSpeed(_speed * GameConfig.PLAYER_TANK_SPEED); }