Exemplo n.º 1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Egg")
     {
         health -= 0.25f;
         Color old  = r.material.color;
         Color newc = new Color(old.r, old.g, old.b, old.a * 0.8f);
         r.material.color = newc;
         Destroy(collision.gameObject);
         mGlobalBehavior.DestroyAnEgg();
     }
 }