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; } } }
private void StartAI() { aiState = AI_TraceAndAttack_State.SearchPlayer; StartCoroutine("FSM"); }
public void Death() { aiState = AI_TraceAndAttack_State.Death; }
private void PlayerExitInAttackArea() { attackingPlayer = false; MobAnimator.SetBool("Attack", false); aiState = AI_TraceAndAttack_State.TracePlayer; }
private void PlayerEnterInAttackArea(Transform player) { this.player = player; aiState = AI_TraceAndAttack_State.AttackPlayer; }
private void PlayerExitInCognitionArea() { trackingPlayer = false; aiState = AI_TraceAndAttack_State.ReturnSpawnCoord; }
// Callback private void PlayerEnterInCognitionArea(Transform player) { this.player = player; readyToNextSearch = true; aiState = AI_TraceAndAttack_State.TracePlayer; }