Storage

public class Storage : ScriptableObject

This class describes main game storage. It stored as SO asset, and example of this file can be found in the Resources/Data folder. Look for asset named Storage. In the same time running game uses only one Storage file.

If you’re extending your game, you can add your own fields to this script and it will appear in the Storage asset file.

To get access to the Storage asset, used in the current game match, you need to use GameController.Instance.MainStorage code.

Example

// this example code can be run from any script, but only on correctly set up scene

Storage storage = GameController.Instance.MainStorage; // gets the actual game Storage asset file

Debug.Log("Default start player money: " + storage.startPlayerMoney); // will print start player money value, which is set up in the Storage asset file