- Home /
Answer by Essential · Oct 14, 2012 at 08:04 AM
I found this answer was better for my particular needs:
http://answers.unity3d.com/questions/53316/game-states-communication-through-scenes-and-objec.html
Answer by gribbly · Oct 14, 2012 at 07:04 AM
It depends how you've implemented your game - are you loading a new scene when you go "in-game"? If so...
Use Object.DontDestroyOnLoad() to preserve some main menu state when loading your game level, then just set a flag. Something like:
bool firstLaunch = true;
void Start(){
if(firstLaunch){
DoStuff();
firstLaunch = false;
}
else{
//back from in-game
}
}
Thanks Cameron. Led me on the right track to find the answer I needed for my particular situation! =)
Your answer
Follow this Question
Related Questions
How to make a Main Menu 3 Answers
Menu not working properly 1 Answer
how to make a main menu to view credits or start game 2 Answers
Start menu gui wont load scene 2 Answers
How To Make A Pause Menu? 1 Answer