In #unity, if you subclass a scriptable object, you can change all (applicable) existing SO's to the new subclass using the debug menu!
Learned this tip just yesterday! Example ahead🧵
In #unity, if you subclass a scriptable object, you can change all (applicable) existing SO's to the new subclass using the debug menu!
Learned this tip just yesterday! Example ahead🧵
Lets say you have a scriptable object called `Enemy`. This has stats like `Health` and `Speed`. You create your enemy SO's like `Slime` and `Wolf`. After a while you realize you actually want to subclass your `Enemy` SO to create a `JumpingEnemy` with a `JumpHeight` parameter.
🧵
Instead of re-creating the `Slime`, you can open it in the inspector, switch to Debug mode, and alter the script that the `Slime` uses from `Enemy.cs` \-> `JumpingEnemy.cs`. Now the `Slime` will keep all it's existing data, and show you the new field for `JumpHeight`!
🧵
Obviously this is a simple example, but if you have multiple different instances of your ScriptableObject that you want to change without losing the data, this can save you a long time!
In my case, my instances had references to prefabs, animation curves, and multiple other paramters. Having to manually re-create them is not only bothersome, but also error-prone. This way I ensured all the common parameters remained the same, and I only edited the ones that were new from the subclass!