Ejemplo n.º 1
0
    /// <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);
        }
    }
Ejemplo n.º 2
0
 /// <summary>
 /// Removes a player live.
 /// </summary>
 private void LiveDown()
 {
     livesManager.ApplyDamage(1);
 }