Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Resolved Allow adding IComponentData and IBufferData directly on gameObject

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

  1. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,109
    Hi

    Do Unity have plans to create Generic Container (i.e. EntityComponentContainer) for IComponent, IBufferElementData and others so we can add this container to game object and simply add all necessary entity components to it and it will auto bake it on entity without us require to write custom Authoring and Baker for simple components?
     
  2. jivalenzuela

    jivalenzuela

    Unity Technologies

    Joined:
    Dec 4, 2019
    Posts:
    76
    No, I'm not aware of any plans like that. Were you thinking these authoring
    GameObjects
    would just be in a root-level scene instead of using the
    SubScene
    workflow?
     
  3. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,109
    No
    This is exacly for subscene and baking. It is just optimisation to not write separate Authoring and Baker (Generic one will take care for us) every time we need simple component with float inside and to not have 2 separate paths for Editor and Runtime because they must operate on different types.
     
  4. jivalenzuela

    jivalenzuela

    Unity Technologies

    Joined:
    Dec 4, 2019
    Posts:
    76
    Ah okay - we're interested in reducing the required boilerplate in Baking, particularly for simple components, although it will almost certainly not be on containers attached to GameObjects.

    If you're looking to reduce boilerplate immediately, let me recommend you check out
    EntityAuthoring
    in the Entities sample project, it should show how to replace some of the functionality that
    GenerateAuthoringComponent
    was providing before