bugfixing
added canvas objects to all scenes (and event systems with them), game should be playable all the way through maybe!
This commit is contained in:
@@ -6,9 +6,9 @@ using TMPro;
|
||||
|
||||
public class DebugSceneSwitcher : MonoBehaviour
|
||||
{
|
||||
|
||||
void Awake() {
|
||||
if (!GameObject.Find("StateController").GetComponent<StateController>().inDebugMode) {
|
||||
|
||||
void Start() {
|
||||
if (!GameObject.Find("StateController").GetComponent<StateController>().inDebugMode) {
|
||||
Destroy(this.gameObject);
|
||||
}
|
||||
// check to see if a debug canvas already exists
|
||||
|
||||
@@ -36,7 +36,7 @@ public class StateController : MonoBehaviour {
|
||||
SceneManager.sceneLoaded += OnSceneLoaded;
|
||||
|
||||
if (inDebugMode) {
|
||||
debugCanvas = GameObject.FindGameObjectWithTag("DebugCanvas");
|
||||
debugCanvas = GameObject.Find("DebugCanvas");
|
||||
debugCanvas.SetActive(false);
|
||||
}
|
||||
}
|
||||
@@ -45,6 +45,9 @@ public class StateController : MonoBehaviour {
|
||||
deathCanvas = GameObject.Find("DeathUICanvas");
|
||||
if (deathCanvas != null) {
|
||||
Button respawnButton = GameObject.Find("RespawnButton").GetComponent<Button>();
|
||||
if (respawnButton == null) {
|
||||
print("respawn button not found!");
|
||||
}
|
||||
respawnButton.onClick.AddListener(RespawnPlayer);
|
||||
deathCanvas.SetActive(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user