Hi all, I am new to Unity and C#, so I hope that the question is in the correct forum and not too trivial.
I basically starting a game building on the Space Shooter Tutorial. I made a new scene with a UI set of menus in which the player can purchase planets and ships based on his score.
So far I managed to pass on variables between my scenes using a “storage script” which is accessible but not attached to any object in any scene. It works well to pass the score around and set the booleans associated with the bonuses to true or false. However I did a bit more of an advanced test of the game yesterday and I realised that every time I go back from the Space Shooter Tutorial scene to my menu scene all the changes the player made are reset.
Before jumping in and adding an endless number of values to my “storage script” which would require setting up every time I quite the menu and recovering every time I go back on it, I was wondering if there was an easier way of going about it ?
I was thinking maybe using the DontDestroyOnLoad function by making all the objects in my menu scene children of an empty gameobject and flipping its status to active/inactive every time I need the menu. This seems to me like an easier way to go about it, expect I might encounter troubles when trying to implement a “Save” functionality to the game.
At this point I am really open to any suggestion, I have just been able to skim the surface of the possibilities offered by Unity and I’m probably not setting about doing things in the easiest of ways.