Example #1
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.gameObject.tag == "enemy")
        {
            takeDamage(10f);
        }

        if (collision.gameObject.tag == "bullet")
        {
            takeDamage(BulletScript.FindObjectOfType <BulletScript>().damage);
        }
    }
Example #2
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.name == "Player")
     {
         //Debug.Log("MARIO'D");
         TakeDamage(health.Max);
     }
     if (collision.gameObject.tag == "bullet")
     {
         TakeDamage(BulletScript.FindObjectOfType <BulletScript>().damage);
     }
 }