From a8741ccc26b4d8a7908d6adf3b7b30f738d2c53e Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Sat, 21 Apr 2018 15:47:24 +1000 Subject: [PATCH] Tweaked bomb --- Assets/Scripts/Bomb.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/Bomb.cs b/Assets/Scripts/Bomb.cs index bf619ec..ebd285a 100644 --- a/Assets/Scripts/Bomb.cs +++ b/Assets/Scripts/Bomb.cs @@ -46,9 +46,11 @@ public class Bomb : MonoBehaviour { } IEnumerator ExplodeAfter(float delay) { - yield return new WaitForSeconds (delay); - explosion.SetActive (true); - transform.DetachChildren (); - Destroy (gameObject); + if (delay >= 0) { + yield return new WaitForSeconds (delay); + explosion.SetActive (true); + transform.DetachChildren (); + Destroy (gameObject); + } } }