My game – like most – has two contexts:
- A) UI screens like start screen, credits or settings
- B) The game itself with levels, players, items, etc.
I have various autoload scripts / singletons which mainly are for B):
For example one singleton adds the camera, another adds the health bar, yet another spawns the player.
They work perfectly there, but this also creates weird situations: E.g. The start screen now has a health bar.
→ So basically how to trigger the autoload in the right scenes / areas of the game and not in others?
What I am looking for:
- I have many ideas already, but since this seems like a common problem …
- … are there any best-practices on this topic? (e.g. an essay / tutorial)
Thanks in advance