Search Unity

Feedback How about a skip conversion tag for every GameObjectConversionSystem

Discussion in 'Entity Component System' started by Lieene-Guo, Dec 22, 2020.

  1. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    547
    Most of the DOTS built-in GameObjectConversionSystem convert Its target Component(Object) no matter what.
    But there are cases that I don't want to convert that Component on some object.
    For example:
    Transform => LocalToWorld: There are data source entities that I just don't want to add any transform info. And transform components are a lot of useless data.
    Skinned mesh Renderer=>RenderMesh: When I want to use a hybrid approach in URP or my own skinning components.

    In these cases, I have to make a late conversion system, to remove unnecessary components.
    But wouldn't it better to have a skip tag to mark that I don't want to use that conversion system on that entity.

    PS: For the no-transform case, I still need them to be part of a converted entity scene. So creating new entity on the fly is not an option (no scene section, no entity guide etc...). If I just let those transform components be there. They will take more storage than the valid data in memory and in serialized scene assets. That's bad.
     
    Tony_Max likes this.
  2. charleshendry

    charleshendry

    Joined:
    Jan 7, 2018
    Posts:
    97
    For unwanted components, I use RemoveComponent within IConvertGameObjectToEntity in my subscene
     
  3. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    547
    Yes, I am doing so. But you really need to know what is Static/Frozen dose it has NoneUniformScale etc. And you also need to know the order of those conversion systems. When using IConvertGameObjectToEntity. You don't even know if the component you want to remove is added before or after your conversion.

    And all of these changes sometimes with Entities package version.
     
    Tony_Max and charleshendry like this.