Example #1
0
    public void GotShot()
    {
        Enemy_Movement behavior = GetComponent <Enemy_Movement> ();

        if (behavior != null)
        {
            behavior.SetAlive(false);
        }

        StartCoroutine(Die());
    }
Example #2
0
    public void GotShot()
    {
        //Halts the enemy movement by summoning the Enemy_Movement script changing them from alive to dead
        Enemy_Movement behavior = GetComponent <Enemy_Movement>();

        if (behavior != null)
        {
            behavior.SetAlive(false);
        }

        StartCoroutine(Die());
    }
Example #3
0
 private void CheckForDeath()
 {
     if (m_Health <= 0)
     {
         score = score + 1;
         if (score >= 4)
         {
             Application.LoadLevel("WinScreen");
         }
         Enemy_Movement behavior = GetComponent <Enemy_Movement>();
         if (behavior != null)
         {
             behavior.SetAlive(false);
         }
         Kill();
     }
 }