Пример #1
0
        //bullet hit collision detection
        void OnCollisionEnter(Collision col)
        {
            if (col.collider.isTrigger)
            {
                return;
            }

            //added 10.8
            IDamage damageableObject = col.collider.GetComponent <IDamage>();

            if (damageableObject != null)
            {
                damageableObject.TakeHit(Damage, col);
            }
            //finished 10.8

            Colliding(col.transform);
            //print(col.gameObject.name);
        }