| This is the script on the DataManager prefab, which is responsible for storing critical data that needs to persist across scene reloads. Additionally, when the game is run through the Main Menu scene, the DataManager will load values from a file rather than using defaults. It will also save these values back to the file while the game is running, and when the application quits. The DataManager is persistent - it can never be destroyed, and there can only be one. This way, if the player loads a new scene by going through a door, the player object can get its health from the DataManager, thus “remembering what health it had.” More...
|