Hello dear programmers,
I've a problem in array of scripts. What I wanted is classes C and B derive from class A. Class D has an array of class A. In editor, I want to drag class C,B on elements of array A in class D. But Unity does not let me do that. I guess, this logic should work or am I missing something?
CodePudding user response:
If you want a custom class to be visible within the inspector it needs to have the system.serialisable
attribute then it will appear within the inspector.
Unity documentation
I think for what your trying to do scriptable objects would be more suitable here is the unity documentation for them. Here is a video tutorial about them as well.