From 354821e71507d3933e63754101d04a270237f624 Mon Sep 17 00:00:00 2001 From: JoelLapointe86 Date: Tue, 1 Dec 2015 20:31:29 -0500 Subject: [PATCH] la bombe tu maintenant l'ennemi la bombe tue les enemies qui ce trouve dans son rayon d'explosion et sur le layer enemies --- Assets/Scripts/Bomb.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Assets/Scripts/Bomb.cs b/Assets/Scripts/Bomb.cs index 37c3b19..8cb4014 100644 --- a/Assets/Scripts/Bomb.cs +++ b/Assets/Scripts/Bomb.cs @@ -47,7 +47,7 @@ public class Bomb : MonoBehaviour layBombs.bombLaid = false; // Find all the colliders on the Enemies layer within the bombRadius. - Collider2D[] enemies = Physics2D.OverlapCircleAll(transform.position, bombRadius, 1 << LayerMask.NameToLayer("Enemy")); + Collider2D[] enemies = Physics2D.OverlapCircleAll(transform.position, bombRadius, 1 << LayerMask.NameToLayer("Enemies")); // For each collider... foreach(Collider2D col in enemies) @@ -58,13 +58,6 @@ public class Bomb : MonoBehaviour { // Find the Enemy script and set the enemy's health to zero. rb.gameObject.GetComponent().removeHP(1000); - - // Find a vector from the bomb to the enemy. - Vector3 deltaPos = rb.transform.position - transform.position; - - // Apply a force in this direction with a magnitude of bombForce. - Vector3 force = deltaPos.normalized * bombForce; - rb.AddForce(force); } }