I am creating my first game in Unity, nothing big actually, but I have run into a situation, where I would like to hear some advices on best approach.
Basically I have Scene 0, which is the main menu, and Scene 1, which is the game. In scene 0 I would like to read in a few values with PlayerPrefs and assign them in a gameobject called GameController. The reason for this is, that the user would be able to change these values in a UI, which is also in Scene 0.
In scene 1 I am using these values too to manipulate the game itself. But the GameController gets destroyed on switching scenes, so I would need to read the values in again, which I am trying to avoid.
The GameController is actually identical in both scenes, so I thought to use DontDestroyOnLoad, but then I would have to remove it from the scene 1 and that is where I see some issues.
- I can not set references to it in other game object in the Inspector.
- If I wanted to change something in the game controller I would have to swtich scene
- I dont see the GameController in the Hierarchy in Scene 1, which I find confusing sometimes, because working with something, that is not there (or atleast not visible)?!?!
Any ideas how to handle these cases?
Or do you think it would be too big of a hastle and I should just let it reconstruct? Would it be a “normal” process that all games do? I am unexperienced with this.