Respawners are disabled when their creation exists

This commit is contained in:
2018-04-22 22:31:44 +10:00
parent 74dbb77574
commit c25705bd01
7 changed files with 75 additions and 3 deletions
+17
View File
@@ -29,6 +29,23 @@ public class Respawner : MonoBehaviour {
instance.SetActive (true);
instance.transform.position = startPos;
timer = float.NegativeInfinity;
//what is it?
if (instance.GetComponent<Bomb>() != null) {
instance.GetComponent<Bomb> ().respawner = this;
}
if (instance.GetComponent<BlockIce>() != null) {
instance.GetComponent<BlockIce> ().respawner = this;
}
this.enabled = false;
}
}
void OnEnable() {
if (timer != float.NegativeInfinity) {
timer = Time.time;
}
}
}