Example #1
0
    public void OnTriggerEnter2D(Collider2D other)
    {
        Destroy destroy = other.gameObject.GetComponent <Destroy>();

        destroy.Hit();
        health -= 100;
        if (health <= 0)
        {
            Die();
        }
    }