Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Feature Request Dynamic Buffers and EntityCommandBuffer

Discussion in 'Entity Component System' started by Opeth001, Jul 26, 2022.

  1. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,068
    Hello Unity Team,

    is it possible to add an API, so users can use ecb.AppendToBuffer to add an item to the existing buffer or add a buffer to the entity if doesn't exist and append the elements.

    Thanks!
     
    Last edited: Jul 26, 2022
    Anthiese and PhilSA like this.
  2. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,926
    I second this. It would save us from adding a BufferFromEntity to the job just to do that check and call different ECB functions based on the presence of it

    I'd also love if there was some in-IDE documentation for most ECB functions, telling us what happens in these cases. It could save us from having to make little tests to find out (or having to look at the sources)

    For example:
    • what happens when calling RemoveComponent and the component isn't there (is it an error, or is the action just skipped?)
    • what happens when calling AddComponent but the component is already there (does it overwrite the component, or just skip?)
    • what happens when we SetComponent but the component isnt there
    • what happens when calling AppendToBuffer but the buffer isn't there
    • what happens when calling AddBuffer but a buffer is already there (with elements in it). Does it clear the buffer, or skip?
    • etc...
    I already know the answer to all of these, but it would be a nice QoL addition if we could get all that info just by hovering over ECB functions in the IDE. Sometimes I'm not sure if I remember well
     
    Last edited: Jul 26, 2022
    JesOb, Opeth001 and Anthiese like this.
  3. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    3,983
    PhilSA and Anthiese like this.