Beispiel #1
0
    public override void Excute()
    {
        _enemy.GoToTarget(_target.position);

        if (_enemy.Search(_target, _enemy._attackRange))
        {
            _enemy.SetState("Attack");
        }
        else if (!_enemy.Search(_target, _enemy._detectionRange))
        {
            _enemy.SetState("Idle");
        }
    }
Beispiel #2
0
 public override void Excute()
 {
     if (!_enemy.Search(_enemy.GetPlayer.transform, _enemy._attackRange))
     {
         _enemy.SetState("Chase");
     }
     else if (_enemy.Attackable)
     {
         _enemy.SetState("Attack");
     }
 }
Beispiel #3
0
    public override void Excute()
    {
        if (_enemy.Search(_enemy.GetPlayer.transform, _enemy._detectionRange))
        {
            _enemy.SetState("Chase");
            return;
        }

        if (_enemy.GoToTarget(_target.position))
        {
            _enemy.SetState(_transition);
        }
    }
Beispiel #4
0
    public override void Excute()
    {
        if (_enemy.Search(_enemy.GetPlayer.transform, _enemy._detectionRange))
        {
            _enemy.SetState("Chase");
            return;
        }

        if (_currentTime >= _stayTime)
        {
            _enemy.SetState(_transition);
        }
        else
        {
            _currentTime += Time.fixedDeltaTime;
        }
    }