lots of small changes lol

worked on tambourine level layout, improved tambourine throwing, created enemy respawn system
This commit is contained in:
slevy14
2023-04-29 14:51:50 -07:00
parent ed3fcf541c
commit 405e20ca2f
11 changed files with 10894 additions and 528 deletions

View File

@@ -19,6 +19,9 @@ public class StateController : MonoBehaviour {
public bool inDebugMode;
GameObject debugCanvas;
[Header("Enemies")]
GameObject[] enemiesInScene;
void Awake() {
// check to see if a state controller already exists
if (GameObject.FindGameObjectWithTag("StateController") != null) {
@@ -50,6 +53,10 @@ public class StateController : MonoBehaviour {
TogglePauseMenu(false);
}
// keep track of all enemies
enemiesInScene = GameObject.FindGameObjectsWithTag("Enemy");
// print(enemiesInScene);
if (isPaused) {
Unpause();
}
@@ -87,9 +94,16 @@ public class StateController : MonoBehaviour {
public void RespawnPlayer() {
SetDeathCanvasActive(false);
GameObject.Find("Main Camera").GetComponent<CameraMovement>().FindPlayer();
RespawnEnemies();
Instantiate(player, spawnPoint.transform.position, player.transform.rotation);
}
public void RespawnEnemies() {
foreach (GameObject enemy in enemiesInScene) {
enemy.SetActive(true);
}
}
public void SetDeathCanvasActive(bool activeState) {
deathCanvas.SetActive(activeState);
}