This repository has been archived on 2026-04-30. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ludumdare41/Assets/Scripts/Bomb.cs
T

23 lines
450 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Bomb : MonoBehaviour {
public float timer;
GameObject explosion;
void Awake() {
StartCoroutine (ExplodeAfter (timer));
explosion = transform.GetChild (0).gameObject;
}
IEnumerator ExplodeAfter(float delay) {
yield return new WaitForSeconds (delay);
explosion.SetActive (true);
transform.DetachChildren ();
Destroy (gameObject);
}
}