fixed: menu navigation, singleton bugs
quit buttons in pause menus are fixed. also the persistent data objects were not deleting themselves if another copy exists, so that's been fixed
This commit is contained in:
parent
e8fcb4e3c4
commit
043f777207
@ -9,7 +9,6 @@ GameObject:
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5026779833035567294}
|
||||
- component: {fileID: 3993188859025174202}
|
||||
- component: {fileID: 4111321198473826588}
|
||||
- component: {fileID: 5193521544595985828}
|
||||
m_Layer: 0
|
||||
@ -32,25 +31,8 @@ Transform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &3993188859025174202
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5592250714439549880}
|
||||
m_Enabled: 0
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 73653b02e42804d288eaaf881c511225, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
canTrumpet: 1
|
||||
canTambourine: 1
|
||||
canClarinet: 1
|
||||
canCymbal: 1
|
||||
currentState: 0
|
||||
--- !u!114 &4111321198473826588
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -69,6 +51,8 @@ MonoBehaviour:
|
||||
isPaused: 0
|
||||
pauseMenuCanvas: {fileID: 0}
|
||||
inDebugMode: 1
|
||||
debugCanvas: {fileID: 0}
|
||||
itemProgression: 0
|
||||
--- !u!114 &5193521544595985828
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -6,10 +6,18 @@ using TMPro;
|
||||
|
||||
public class DebugSceneSwitcher : MonoBehaviour
|
||||
{
|
||||
public static DebugSceneSwitcher Instance = null;
|
||||
|
||||
public bool showDropdown;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (Instance == null) {
|
||||
Instance = this;
|
||||
} else {
|
||||
Destroy(this.gameObject);
|
||||
return;
|
||||
}
|
||||
// Keep the object around when we switch scenes
|
||||
DontDestroyOnLoad(this.gameObject);
|
||||
CreateDropdownOptions();
|
||||
|
@ -18,7 +18,7 @@ public class SceneController : MonoBehaviour
|
||||
}
|
||||
else
|
||||
{
|
||||
Destroy(this);
|
||||
Destroy(this.gameObject);
|
||||
return;
|
||||
}
|
||||
// Make this object stay around when switching scenes
|
||||
@ -31,8 +31,8 @@ public class SceneController : MonoBehaviour
|
||||
GameObject pauseMenu = GameObject.Find("PauseMenuCanvas");
|
||||
if (pauseMenu != null)
|
||||
{
|
||||
Button quitButton = GameObject.Find("QuitButton").GetComponent<Button>();
|
||||
quitButton.onClick.AddListener(BackToMainMenu);
|
||||
// Button quitButton = GameObject.Find("QuitButton").GetComponent<Button>();
|
||||
// quitButton.onClick.AddListener(BackToMainMenu);
|
||||
}
|
||||
if (scene.buildIndex == 0)
|
||||
{ // if this is the menu
|
||||
|
@ -46,6 +46,9 @@ public class StateController : MonoBehaviour
|
||||
if (Instance == null)
|
||||
{
|
||||
Instance = this;
|
||||
} else {
|
||||
Destroy(this.gameObject);
|
||||
return;
|
||||
}
|
||||
DontDestroyOnLoad(this.gameObject);
|
||||
SceneManager.sceneLoaded += OnSceneLoaded;
|
||||
@ -102,6 +105,8 @@ public class StateController : MonoBehaviour
|
||||
{
|
||||
Button resumeButton = GameObject.Find("ResumeButton").GetComponent<Button>();
|
||||
resumeButton.onClick.AddListener(Unpause);
|
||||
Button quitButton = GameObject.Find("QuitButton").GetComponent<Button>();
|
||||
quitButton.onClick.AddListener(SceneController.Instance.BackToMainMenu);
|
||||
TogglePauseMenu(false);
|
||||
}
|
||||
|
||||
@ -180,8 +185,10 @@ public class StateController : MonoBehaviour
|
||||
|
||||
void TogglePauseMenu(bool showPauseMenu)
|
||||
{
|
||||
if (pauseMenuCanvas != null) {
|
||||
pauseMenuCanvas.SetActive(showPauseMenu);
|
||||
}
|
||||
}
|
||||
|
||||
public void RespawnPlayer()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user