コード例 #1
0
 private void ExplodeEnemy()
 {
     if (destroyPortal != null)
     {
         if (string.Compare(name, "Alien_CyanGlow(Clone)") == 0)
         {
             DeathScream.playDeathScreamCyan();
         }
         if (string.Compare(name, "Alien_YellowGlow(Clone)") == 0)
         {
             DeathScream.playDeathScreamYellow();
         }
         if (string.Compare(name, "Alien_WhiteGlow(Clone)") == 0)
         {
             DeathScream.playDeathScreamWhite();
         }
         if (string.Compare(name, "Mr Grey(Clone)") == 0)
         {
             DeathScream.playDeathScreamGrey();
         }
         destroyPortal.incrementSpawnsKilled();
         GetComponent <MeshExploder>().Explode();
         transform.parent.gameObject.SetActive(false);
         collided = false;
         transform.parent.gameObject.transform.parent = null;
     }
     else
     {
         if (string.Compare(name, "Alien_CyanGlow(Clone)") == 0)
         {
             DeathScream.playDeathScreamCyan();
         }
         if (string.Compare(name, "Alien_YellowGlow(Clone)") == 0)
         {
             DeathScream.playDeathScreamYellow();
         }
         if (string.Compare(name, "Alien_WhiteGlow(Clone)") == 0)
         {
             DeathScream.playDeathScreamWhite();
         }
         if (string.Compare(name, "Mr Grey(Clone)") == 0)
         {
             DeathScream.playDeathScreamGrey();
         }
         DeathScream.playDeathScreamCyan();
         GetComponent <MeshExploder>().Explode();
         transform.parent.gameObject.SetActive(false);
         collided = false;
         transform.parent.gameObject.transform.parent = null;
     }
 }