So far I have two scenes in my game:
- the main menu scene
- the actual game scene
In the main menu screen I have a button which enables a type of game mode. If enabled, the player won’t be able to save the game (by disabling the save game script).
I want to know how do I access a Boolean in a script in the Main Menu scene from a script in my Game scene so that I can disable my save game script (C# only).
For example: In Main Menu scene I would have:
public static bool hardcoreMode;
void Awake ()
{
//some code..
hardcoreMode = false;
//more code..
}
void OnGUI()
{
//some code...
if(GUILayout.Button("HardCore Mode"))
hardcoreMode = true;
//more code...
}
So how do I access the Boolean “hardcoreMode” from a script in my Game scene?
(Beginner in Unity and scripting in general)