Getting all component types (even those not on the scene)

Hello, I am making an editor window which calls functions based on two fields, component name and function name.

Before I call the function, I’d like to verify if the component name is valid. For that, I need a list of all component types.

Is there any way to know that? I’ve tried using reflection and loading assemblies, but couldn’t find the right assembly file with the components.

Thank you in advance,

I just made a ComponentDatabase utility class. It can be used to get a list of all components that are derived from a certain base class or that implement a certain interface (GetTypes method).

In addition you can search for components by name by using FindComponent. Note FindComponent returns a “TypeNode” which is a simple linked list. This is used because since we have namespace support the same component name can refer to different classes.

GetAllTypes() returns an IEnumerable of all Component types in your project including build in components. Abstract classes are not included in the list.