Tweaked bomb

This commit is contained in:
2018-04-21 15:47:24 +10:00
parent 7d10afcbf9
commit a8741ccc26
+6 -4
View File
@@ -46,9 +46,11 @@ public class Bomb : MonoBehaviour {
} }
IEnumerator ExplodeAfter(float delay) { IEnumerator ExplodeAfter(float delay) {
yield return new WaitForSeconds (delay); if (delay >= 0) {
explosion.SetActive (true); yield return new WaitForSeconds (delay);
transform.DetachChildren (); explosion.SetActive (true);
Destroy (gameObject); transform.DetachChildren ();
Destroy (gameObject);
}
} }
} }