Generic Parent/Child ComponentSystem<T>?

I was trying to make a generic version of the ParentSystem, such that an entity could have multiple parents depending on the generic context. For example a House might be a child of a Neighborhood in a transform context, but in a Power context its parent might be a PowerPlant, which might be on a different transform root, or in an Ownership perspective its parent might be an NPC which is currently inside it.

But it seems like concrete versions of a ComponentSystem don’t have their OnCreate() called, even if explicitly with a GetOrCreateSystem<GenericParentSystem<Power>>() for example. I didn’t see any examples of generic systems in the ECS Samples project either.

Are generic component systems simply not possible?

Edit: This is how I’m using RegisterGenericComponentType
[assembly: RegisterGenericComponentType(typeof(GenericParentSystem<Power>))]

Sub-classing them into a normal class works fine by me. For purely Generic systems, you have to manually add them to the execution order or more simply a System group.

1 Like

Thank you! I wasn’t able to get a pure generic system to work, but subclassing did.
EDIT: Pure generics work too