Loading Particular UI from Different Scene
How would you access the Options/Settings Menu from an in-game Pause Menu? I understand loading the different scene on the button click, but the scene I load (via loadscene) opens with my Main Menu UI. I want to load the Options/Settings UI when I load the Main Menu scene. I think just loading the Main Menu scene, then deactivating the Main Menu UI gameObject and activating the Options/Settings UI gameObject would be sufficient, but it only loads the Main Menu UI on scene change.
Here is my code for the button click (for loading the Options/Settings Menu UI):
public enum GameOverStates
{
Main,
Store,
};
public GameOverStates currentState;
public GameObject mainMenu;
public GameObject storeMenu;
void Update()
{
switch (currentState)
{
case GameOverStates.Store:
mainMenu.SetActive(false);
storeMenu.SetActive(true);
break;
}
}
// Switch to Store Menu
public void OnStore()
{
UnityEngine.Debug.Log("The fucking store");
//Change menu state
Loader.Load(Loader.Scene.MainMenu);
currentState = GameOverStates.Store;
////Play sound effect
SoundManager.PlaySound(SoundManager.Sound.ButtonClick);
}
Thank for you any help :)
Your answer
Follow this Question
Related Questions
Can't make game windowed. 0 Answers
C# Player Prefs & Toggle| Will not save settings 1 Answer
Materials do not load when a new scene is loaded realtime? 1 Answer
GameObjects Missing When I Re-Load Scene 0 Answers
next level 1 Answer