Beispiel #1
0
    void OnCollisionEnter(Collision col)
    {
        GameObject hitGo       = col.gameObject;
        IHealth    hitGoHealth = hitGo.GetComponent <IHealth>();

        if (hitGoHealth != null)
        {
            hitGoHealth.DoDamage(Damage);
        }
        Destroy(gameObject, 0.001f);
    }