Creating ScriptableObject monsters
The great part of our monster configuration scenario is that we can have fun with the inheritance; some values can be pulled right from the base type, and others can be combined (like a monster’s color) or added to the existing value (like a monster’s weaknesses). The sky is really the limit with this pattern – you make all the rules.
In the Scripts folder, create a new C# script named SOType
and update its code to match the following code. There’s a fair bit going on in this code, but if you look closely, we’re applying what we’ve already learned in a new wrapper. Our type object still has a set of properties we want to inject into another object, and they can either be set in the Editor or optionally inherited from a base object of our choice.
I know Pokemon might not be monsters in the strictest sense, but I love them and this design pattern makes it so much fun to mix and match traits to...