示例#1
0
        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);
        }
示例#2
0
        public override void Update(float deltaTime)
        {
            if (_agent == null)
            {
                return;
            }

            _agent.SetDesiredDirection(_moving);
            _agent.SetDesiredFacing(_facing);
            _agent.SetDesiredSpeed(_speed * GameConfig.PLAYER_TANK_SPEED);
        }