Scene Set up

10_ScriptableSingletons

In this scene, when you enter Play mode, a bunch of coins are spawned. Each coin rotates its visual at a specific speed. The player can collide with a coin to collect it, which increments the coin counter at the top of the screen.

While iterating, you might want to change certain parameters quickly. Find the SoapGameParams Scriptable Singleton at: Obvious/Soap/Examples/Content/Resources

Click on it, then lock that Inspector window. Alternatively, you can press ALT + P on it to open an independent, dockable window that will keep that asset inspected.

Now let’s mess around:

  • Change the Coin Rotate Speed and see it affect the game in real time.

  • Change the Coin Spawn Amount, then click the Raise button just above the Reload Scene event. This lets you quickly restart the scene and test different coin counts.

  • Toggle Random Player Color Mode, then reload the scene (example of turning options on/off).

Finally, I also added a reference to the Player Health Scriptable Variable. Sometimes it’s useful to keep frequently used variables in a single place where you can access everything related to your game.

Last updated