- Home /
Question by
ZenRumiko · Jul 21, 2015 at 02:22 PM ·
c#reflectioninheritancetype
I need an Array of System.type[] from all of my ScriptableObjects scripts
I'm having a little trouble finding a way to get a list of all my scripts in System.type[] form from all my scriptable object scripts that inherit from a base class. After some goggling I found this which works and returns everything but the classes that I have that derive from scriptable object:
System.Type[] types = System.Reflection.Assembly.GetExecutingAssembly().GetTypes();
System.Type[] possible = (from System.Type type in types where type.IsSubclassOf(typeof(BaseClass)) select type).ToArray();
I couldn't find anything on Google, thanks for the help in advance.
Comment