mirror of
https://github.com/frizbee19/FebGameJam.git
synced 2026-10-11 18:19:11 +00:00
Auto stash before revert of "Merge remote-tracking branch 'origin/main' into main"
This commit is contained in:
1 parent
e3bfa843e5
commit
d49638100e
2 files changed
+12
-49
No files matched your search
@@ -9,6 +9,9 @@ public class SpawnTrigger : Trigger
|
||||
[SerializeField] Vector2 startPos;
|
||||
private GameObject clone;
|
||||
private bool spawned;
|
||||
[SerializeField] bool respawns = false;
|
||||
[SerializeField] float respawnTime = 3f;
|
||||
private float elapsed = 0f;
|
||||
|
||||
|
||||
|
||||
@@ -21,10 +24,17 @@ public class SpawnTrigger : Trigger
|
||||
this.gameObject.SetActive(false);
|
||||
}
|
||||
public override void Action() {
|
||||
if(!spawned) {
|
||||
if(!spawned && !respawns) {
|
||||
Debug.Log("spawn");
|
||||
StartCoroutine(SpawnDespawn());
|
||||
}
|
||||
else if(respawns) {
|
||||
if(elapsed < respawnTime) {
|
||||
elapsed = 0;
|
||||
|
||||
StartCoroutine(SpawnDespawn());
|
||||
}
|
||||
}
|
||||
}
|
||||
// Start is called before the first frame update
|
||||
|
||||
|
||||
Reference in new issue
Block a user