- Home /
Restarting the entire game
Our game is an online game, and we added to make it reconnect and restart the game when returning from background after a certain period of time. There are singletons, DontDestroyOnLoad, and such, so just loading the first scene doesn't work and is turning out to be a big mess to debug...
So my question, is there any way to completely restart a game (terminate the process and restart it, so that the entire memory is cleared, including singletons, all objects, etc)? Any ideas?
Answer by senc01a · Sep 07, 2014 at 11:56 AM
To my knowledge this is not possible, which is especially true on iOS devices, where due to sandboxing rules you are not allowed to create or stop processes. Your best call is to reload a scene, and manually destroy or re-create those singleton objects which you have marked as keep alive, with the DontDestroyOnLoad procedure.
Thanks, I figure you are probably right. I'll leave the question open a bit more to see if anyone can say for sure, or if there are other creative ideas...
Your answer
![](https://koobas.hobune.stream/wayback/20220613162504im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Singleton and MonoBehaviour in Editor 1 Answer
Design Patterns (Singleton Issue) 1 Answer
Retaining Reference to Singleton GameObject 1 Answer
Singleton's property is always null 2 Answers