Search Unity

Hierarchical Injection of entities?

Discussion in 'Entity Component System' started by thelebaron, Mar 12, 2020.

  1. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    857
    ConvertAndInject only works on the top most GameObject. Obviously you can create entities via CreateAdditionalEntity but the conversion systems won't function for them.

    GameObjectConversionUtility.ConvertGameObjectHierarchy does not appear to play nice in conjunction with ConvertToEntity conversion, ie while it will convert a hierarchy, you wont be able to reference entities if you need to setup references between a utility converted hierarchy and an entity created from inject.

    Whats the workaround here? Id like to take advantage of the recently released LegacyPhysicsJointConversion but currently my biggest issue needing something between the very limiting use of Inject on the root object and the brute force conversion of an entire hierarchy.
    Whats the reasoning behind why child objects(with inject on the root) with a IConvertGameObjectToEntity wont get picked up in conversion?