Example #1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "RunningNPC" || other.tag == "EscapeNPC")
     {
         if (!anim.GetBool("isStandBy"))
         {
             anim.SetBool("isStandBy", true);
         }
         lerpValueRateOfIncrease = 0;
     }
     else if (other.tag == "Enemy" && transform.tag == "Enemy")
     {
         StopAllCoroutines();
         EnemyCharacter enemy = other.GetComponent <EnemyCharacter>();
         enemy.StopAllCoroutines();
         transform.tag = "AttackEnemy";
         enemy.tag     = "AttackEnemy";
         transform.LookAt(enemy.transform);
         enemy.transform.LookAt(transform);
         if (priority >= enemy.GetPriority())
         {
             enemy.GetAnimator().SetBool("isStandBy", true);
             anim.SetBool("isShoot", true);
             StartCoroutine(SeeAnotherEnemy(enemy));
         }
         else
         {
             anim.SetBool("isStandBy", true);
             enemy.GetAnimator().SetBool("isShoot", true);
             enemy.StartCoroutine(enemy.SeeAnotherEnemy(this));
         }
     }
 }