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); } }
private void OnCollisionEnter(Collision collision) { if (collision.gameObject.layer == enemyCarLayer) { bulletHelper.searchAndDestroy(collision.gameObject, "EnemyCar", gameObject, carCanonDamage); } }
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); }