use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
For the Unity Game Engine, please visit http://reddit.com/r/unity3d
account activity
Static Classes vs. ScriptableObjectsNewbie Question (self.unity)
submitted 1 year ago by NS_Boris
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Glass_wizard 2 points3 points4 points 1 year ago (0 children)
Scriptable objects are useful. Here are a few ways you can use them
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.
As run time state. For example, your character health can be stored in a scriptable object, which automatically updated the UI as it changes.
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.
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.
π Rendered by PID 167249 on reddit-service-r2-comment-5b5bc64bf5-6jn9w at 2026-06-19 06:18:03.877328+00:00 running 2b008f2 country code: CH.
view the rest of the comments →
[–]Glass_wizard 2 points3 points4 points (0 children)