Custom Scriptable Singleton

Scriptable Singleton

In the examples provided in Soap, you can find an example of a Scriptable Singleton at Obvious/Soap/Examples/Content/Resources :

SoapGameParams

When making your own game, you will want to create your own custom scriptable singleton. There are 2 ways to do it:

  • By code (Create a class inheriting from ScriptableSingleton<T> - where T is the name of your Singleton class.

  • Using the Soap Type creator (Clicking on scriptable singleton type will open a new pop up)

If you enable the "Create Instance at Resources Path", it will automatically create the Scriptable Singleton Instance at a specific path once the code has compiled. Make sure to end the path with /Resources

The Singleton will be loaded via the Resources.Load API.

For more detailed explanation and examples of Scriptable Singleton , please refer to the example scene '10_ScriptableDictionaries_Example_Scene' and its documentation.

Last updated