Quick question: I’m using an in-game menu which is the same on all the levels. Currently I’m using a separate scene which holds the menu, and I load it using Additive loadScene mode on each level.
However, it’s not ideal for debugging and communication via scripts (as I understand, the “Find” method is to be avoided).
Would it make more sense to use a Prefab in this case? I have very little experience with this setup so what would be the best way to instantiate the menu?
I always have a GameManager that creates a Camera on startup which never gets destroyed (DontDestroyOnLoad), that camera contains all the user interface stuff that I can show/hide depending on the situation. I think that’s more or less using a prefab I guess
You can make a prefab of the whole menu and its scripts and load it from the resources upon pressing a key. You can do this by creating a new prefab and dragging the parent object that holds the menu onto the newly created prefab (remember to have it in the Resources folder to load it). You’re gonna have to pause the game, so don’t forget to control that when calling the menu!
@SiegfriedCroes That’s actually a smart idea which also makes me realize I haven’t been using the full potential of Hierarchy - starting to see other stuff I could parent…
@Joimer Cool! I’ll test that idea out. I guess that means in order to test / debug / modify the menu I’d need to add the prefab to the current scene temporarily, right?
You can also make a separate scene with the prefab in it to modify and apply changes when needed. That way you don’t always have to place it in the scene to make changes