IMPLEMENT MONOSINGLETON
To complete this Game Based Example, complete these three steps...
Create a MonoSingleton Script
Create a SpawnManager Script that utilizes the MonoSingleton Design Pattern
Access the SpawnManager from the GameManager
STEP ONE
OBJECTIVE: CREATE A MONOSINGLETON SCRIPT
STEP TWO
OBJECTIVE: Create a SpawnManager Script that utilizes the MonoSingleton Design Pattern
CODE BREAKDOWN
There is no need to declare this script as a Singleton class as it is being forced to gain the MonoSingleton properties with SpawnManager
replacing the Type Parameter within the MonoSingleton Script.
STEP THREE
OBJECTIVE: Access the SpawnManager from the GameManager
CODE BREAKDOWN
With only a few lines of code from within the GameManager script and the SpawnManager script, the program can easily access public methods from each script.
Last updated