I have a simpe scriptable object class RecourseSO
that is parent to all other recourse scriptable objects for exampe RecourseSO_Wood
. Since all children are very simple(they dont declare new functions or variables) I just decided to put them in one script RecourseData
. But when I create SOs of these classes I get a unity warning about not finding script of created SO(No script asset for RecourceSO_Stone. Check that the definition is in a file of the same name and that it compiles properly.). Should I give each child its own file? Does it matter?
Yes, all scriptable objects and MonoBehaviour classes need to be in their own file, with the file name matching the class name.
3 Likes