/// <summary> /// Raises the collision enter event. /// </summary> /// <param name="collision"> The collision. </param> void OnCollisionEnter(Collision collision) { GameObject other = collision.gameObject; if (other.CompareTag("Player")) { LivesManager lv = other.gameObject.GetComponent <LivesManager>(); lv.ApplyDamage(damage); Destroy(gameObject); } }
/// <summary> /// Removes a player live. /// </summary> private void LiveDown() { livesManager.ApplyDamage(1); }