Beispiel #1
0
    private void OnCollisionEnter(Collision collision)
    {
        BulletKills bk = collision.gameObject.GetComponentInParent <BulletKills>();
        Death       de = collision.gameObject.GetComponentInParent <Death>();

        if (!bEnemyProjectile && bk != null)
        {
            bk.TakeDamage(Damage);
            Destroy();
        }
        else if (bEnemyProjectile && de != null)
        {
            de.TakeDamage(Damage);
            Destroy();
        }
        else if (!(collision.gameObject.tag == "Player"))
        {
            Destroy();
        }
    }