Why are Collider and similar not marked abstract for reflection (type.isAbstract)?

As the title says, when trying to use reflection to build a list of component types, Collider and similar base types of unity are included as their isAbstract property wrongly returns false.
Is there another way to check around this misconfiguration for abstract-ness?

Manually exclude them from your types. Maybe hard write a static list of excluded types.

As to why they’re not abstract, none of Unity’s ‘base’ classes are abstract. There’s probably some low level reason for this. Probably something to do with the fact most of these c# classes are ‘wrappers’ around the C++ objects on Unity’s native side.

1 Like

That would take me a very long time that i currently don’t have, walking through all unity components, manually creating a list of ones to exclude.
I guess i’ll have to live with subpar inspector experience for now

Well there are some pretty obvious ones you’d put in the list so it doesn’t hurt to spend a few minutes typing up the first that come to mind.

1 Like