示例#1
0
 public override void EnterState(BaseAIMovementController owner)
 {
     _attackingState    = new BasicMeleeAttackingState();
     _returnToIdleState = new BasicMeleeReturnToIdleState();
     GlobalState.state.AudioManager.BasicEnemyAlerted(owner.transform.position);
     base.EnterState(owner);
 }
示例#2
0
    public override void ExitState(BaseAIMovementController owner)
    {
        for (int i = 0; i < owner.meleeEnemy._healthBar.transform.childCount; i++)
        {
            owner.meleeEnemy._healthBar.transform.GetChild(i).gameObject.SetActive(false);
        }

        base.ExitState(owner);
    }
示例#3
0
    public override void EnterState(BaseAIMovementController owner)
    {
        base.EnterState(owner);

        _attackingState    = new RangedEnemyAttackingState();
        _returnToIdleState = new RangedEnemyReturnToIdleState();

        GlobalState.state.AudioManager.RangedEnemyAlertAudio(owner.rangedAI.transform.position);
    }
示例#4
0
    public override void UpdateState(BaseAIMovementController owner)
    {
        owner._attackRateTimer += Time.deltaTime;

        //float range = owner._attackRange - owner._agent.stoppingDistance;
        float range = owner._attackRange;

        owner.FacePlayer();

        if (range < Vector3.Distance(owner._target.transform.position, owner.transform.position))
        {
            owner.stateMachine.ChangeState(_chasingState);
        }
        else if (range > Vector3.Distance(owner._target.transform.position, owner.transform.position))
        {
            if (owner._attackRateTimer.Expired)
            {
                owner.stateMachine.ChangeState(new BasicMeleeSwingState());
            }
        }
    }
示例#5
0
    public override void UpdateState(BaseAIMovementController owner)
    {
        if (owner._attackRange < Vector3.Distance(owner._target.transform.position, owner.transform.position))
        {
            owner.stateMachine.ChangeState(_chasingState);
        }
        else if (Vector3.Distance(owner._target.transform.position, owner.transform.position) < owner.rangedAI._meleeRange)
        {
            if (owner._attackRateTimer.Expired)
            {
                owner.stateMachine.ChangeState(new RangedEnemySwingState());
            }
        }

        owner._attackRateTimer += Time.deltaTime;

        owner.rangedAI.FacePlayer();

        if (owner._attackRateTimer.Expired && Vector3.Distance(owner._target.transform.position, owner.transform.position) > owner.rangedAI._meleeRange)
        {
            owner.stateMachine.ChangeState(new RangedEnemyFiringState());
        }
    }
示例#6
0
 public override void EnterState(BaseAIMovementController owner)
 {
     _chasingState = new ShadowEnemyChasingState();
     _idleState    = new ShadowEnemyIdleState();
 }
示例#7
0
 public override void EnterState(BaseAIMovementController owner)
 {
     _attackingState    = new ShadowEnemyAttackingState();
     _returnToIdleState = new ShadowEnemyReturnToIdleState();
 }
示例#8
0
 public override void UpdateState(BaseAIMovementController owner)
 {
     base.UpdateState(owner);
     owner._attackRateTimer += Time.deltaTime;
 }
示例#9
0
 public override void EnterState(BaseAIMovementController owner)
 {
     _chasingState = new BasicMeleeChasingState();
     _idleState    = new BasicMeleeIdleState();
     base.EnterState(owner);
 }
示例#10
0
 public override void UpdateState(BaseAIMovementController owner)
 {
     base.UpdateState(owner);
 }
示例#11
0
 public override void EnterState(BaseAIMovementController owner)
 {
     _chasingState = new RangedEnemyChasingState();
     _idleState    = new RangedEnemyIdleState();
     base.EnterState(owner);
 }
示例#12
0
 public override void EnterState(BaseAIMovementController owner)
 {
     owner.GenerateNewAttackTimer();
     _chasingState = new RangedEnemyChasingState();
     base.EnterState(owner);
 }