Design Pattern: Singleton
- Game AI Club
- Mar 13, 2023
- 1 min read
This week's progress is very simple. We learn about the DontDestroyOnLoad function to ensure only one game manager is on the scene. This function is useful when we want a certain game object to only have one instance in the scene. This pattern is called singleton. This way, it reduces the unnecessary gameobject's instance.

In the Game Manager gameobject, we hold the grid manager, robot manager, and UI manager script to handle things accordingly. The grid manager handles the tile structure and the generation of the tile map. The robot manager handles the robot spawn. While the UI manager handles the scene UI.

Comments