예제 #1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Boundary") || other.CompareTag("Enemy") || other.CompareTag("Boss"))
     {
         return;
     }
     {
         if (explosion != null)
         {
             Instantiate(explosion, transform.position, transform.rotation);
         }
         gamecontroller.addScore(score_value);
         if (other.CompareTag("Player"))
         {
             Instantiate(Player_explosion, other.transform.position, other.transform.rotation);
             gamecontroller.GameOver();
             gamecontroller.RestartButtonActivate();
         }
         Destroy(other.gameObject);
         Destroy(gameObject);
     }
 }