Esempio n. 1
0
        private void OnCollisionEnter(Collision collision)
        {
            GameObject hitGameObject = collision.gameObject;

            if (hitGameObject.name == "Car")
            {
                bulletHelper.searchAndDestroy(hitGameObject, hitGameObject.name, gameObject, 4f);
            }
            else if (hitGameObject.name == "EnemyCar")
            {
                bulletHelper.searchAndDestroy(hitGameObject, hitGameObject.name, gameObject, 6f);
            }
        }
Esempio n. 2
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.layer == enemyCarLayer)
     {
         bulletHelper.searchAndDestroy(collision.gameObject, "EnemyCar", gameObject, carCanonDamage);
     }
 }
Esempio n. 3
0
        private void OnCollisionEnter(Collision collision)
        {
            GameObject hitGameObject = collision.gameObject;


            if ((hitGameObject.name == "Car"))
            {
                bulletHelper.searchAndDestroy(
                    hitGameObject,
                    hitGameObject.name,
                    gameObject,
                    enemyCarBullerDamage);
                bulletHelper.makeImpact(collision, impactParticls);
            }
            else if ((hitGameObject.tag == "Enemy"))
            {
                bulletHelper.searchAndDestroy(
                    hitGameObject,
                    hitGameObject.name,
                    gameObject,
                    carBullerDamage);
                bulletHelper.makeImpact(collision, impactParticls);
            }
        }
 private void OnCollisionEnter(Collision collision)
 {
     bulletHelper.searchAndDestroy(collision.gameObject, "Car", gameObject, 10f);
 }