예제 #1
0
    private IEnumerator ReturnSpawnCoord()
    {
        bool nowReturing = true;

        CognitionArea.gameObject.SetActive(false);
        AttackArea.gameObject.SetActive(false);
        NavAgent.SetDestination(Controller.SpawnCoord);
        MobAnimator.SetBool("Move", true);

        while (nowReturing && aiState == AI_TraceAndAttack_State.ReturnSpawnCoord)
        {
            yield return(new WaitForEndOfFrame());

            if (aiState != AI_TraceAndAttack_State.ReturnSpawnCoord)
            {
                yield break;
            }
            if (AgentIsArrivedOnTarget())
            {
                nowReturing = false;
                aiState     = AI_TraceAndAttack_State.SearchPlayer;
            }
        }
    }
예제 #2
0
 private void StartAI()
 {
     aiState = AI_TraceAndAttack_State.SearchPlayer;
     StartCoroutine("FSM");
 }
예제 #3
0
 public void Death()
 {
     aiState = AI_TraceAndAttack_State.Death;
 }
예제 #4
0
 private void PlayerExitInAttackArea()
 {
     attackingPlayer = false;
     MobAnimator.SetBool("Attack", false);
     aiState = AI_TraceAndAttack_State.TracePlayer;
 }
예제 #5
0
 private void PlayerEnterInAttackArea(Transform player)
 {
     this.player = player;
     aiState     = AI_TraceAndAttack_State.AttackPlayer;
 }
예제 #6
0
 private void PlayerExitInCognitionArea()
 {
     trackingPlayer = false;
     aiState        = AI_TraceAndAttack_State.ReturnSpawnCoord;
 }
예제 #7
0
 // Callback
 private void PlayerEnterInCognitionArea(Transform player)
 {
     this.player       = player;
     readyToNextSearch = true;
     aiState           = AI_TraceAndAttack_State.TracePlayer;
 }