lots of small changes lol
worked on tambourine level layout, improved tambourine throwing, created enemy respawn system
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user