So I want to be able to select a script (that is not a monobehaviour) in the editor my classes look like this.
Classes to be selected from:
[System.Serializable]
public class ExClass1 {
//Do basic stuff
}
[System.Serializable]
public class ExClass2 : ExClass1 {
//Do more stuff specific to class 2
}
[System.Serializable]
public class ExClass3 : ExClass1 {
//Do more stuff specific to class 3
}
These are the three classes I want to choose from, notice they do not inherit from MonoBehaviour.
Then the container class which does inherit from MonoBehaviour.
public class ContainerClass : MonoBehaviour {
ExClass1[] classes;
}
What I want to do is be able to attach this class to a GameObject and then choose what type (ExClass1, ExClass2, ExClass3) for the GameObject to use. I know this is possible through custom inspectors and a lot of extra work. I tried using ScriptableObjects but it seems that using a ScriptableObject to save instances of the class seems ill fitted for what I want to do. I haven’t tried this yet but I suppose I could make ExClass1 inherit from MonoBehaviour and then select it from there, but that would add a lot of memory overhead in my case. So my question is, is there anyway to do this natively in unity or via a plugin anywhere? Thanks!