コード例 #1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Cookie"))
     {
         other.GetComponent <Cookie>().Collide();
         Destroy(other.gameObject);
     }
     else if (other.CompareTag("Ghost"))
     {
         Ghost ghost = other.GetComponent <Ghost>();
         if (ghost.CanKillPacman())
         {
             if (!InGameManager.Instance.PowerOverwhelming)
             {
                 isDeath = true;
                 animator.SetTrigger("Death");
             }
         }
         else
         {
             ghost.SetState(GhostState.Death);
             InGameManager.Instance.EatGhost(transform.position);
         }
     }
 }