Search Unity

Question Baking and Entity Fields in Shared Component Data

Discussion in 'DOTS Dev Blitz Day 2022 - Q&A' started by Kmsxkuse, Dec 8, 2022.

  1. Kmsxkuse

    Kmsxkuse

    Joined:
    Feb 15, 2019
    Posts:
    306
    Has there been any work done to support Entity fields in shared component data that are remapped at subscene streaming load?
     
  2. jivalenzuela

    jivalenzuela

    Unity Technologies

    Joined:
    Dec 4, 2019
    Posts:
    76
    To be clear, you have an Entity field in a bake-time shared component that you expect to get patched up when the subscene loads?
     
    Kmsxkuse likes this.
  3. Kmsxkuse

    Kmsxkuse

    Joined:
    Feb 15, 2019
    Posts:
    306
  4. jivalenzuela

    jivalenzuela

    Unity Technologies

    Joined:
    Dec 4, 2019
    Posts:
    76
    Does the entity field refer to something else in the same scene?
     
    Kmsxkuse likes this.
  5. Kmsxkuse

    Kmsxkuse

    Joined:
    Feb 15, 2019
    Posts:
    306
    Yes. I simply wish to know if the same restrictions and behaviors that entities currently existing in unmanaged component data and buffer elements can apply to shared component data.
     
  6. Kleptine

    Kleptine

    Joined:
    Dec 23, 2013
    Posts:
    282
    Similarly, I recently hit an issue with Entity references in shared components, when using CopyEntities. If you copy an entity with the SceneTag component, it isn't properly patched, and so the SceneTag ends up corrupted.

    Is there any more information on the treatment of SharedComponents floating around? I'm kind of surprised they're not handled correctly by the core EntityManager public methods like CopyEntities.
     
  7. Thygrrr

    Thygrrr

    Joined:
    Sep 23, 2013
    Posts:
    700
    I think it's absolutely fundamentally important to be able to reference other entities coming from other game objects in the same authoring scene - while also being able to reference the authoring data.

    This used to work in earlier versions.

    If that's impossible, you need to provide alternative baking means than subscenes. Baking systems don't cut it because they have no access to the authoring data any more.