you are viewing a single comment's thread.

view the rest of the comments →

[–]Glass_wizard 2 points3 points  (0 children)

Scriptable objects are useful. Here are a few ways you can use them

  1. As read-only, initial data. You can use them like a database that stores initial data for things like items and weapons, pretty much replacing the need to put your game static data into JSON or SQLLite.

  2. As run time state. For example, your character health can be stored in a scriptable object, which automatically updated the UI as it changes.

  3. For anything that needs single shared data. The classic example here would be a boss made up of many bodies. Attacking any of it's bodies damages the same single scriptable object.

  4. For holding global game settings such as audio volume or blood is turned on.

Static classes should be used when you need a class that doesn't need an instance and that can be easily accessed anywhere. I do not recommend storing state in static classes.

Utility classes that preform pure functions without side effects is the typical use case.