I need to be able to both add a DynamicBuffer to an entity and then populate it with elements in the same job. This seems impossible at the moment because EntityCommandBuffer commands do not play back until after the job at the end of the frame, so the DynamicBuffer does not exist on the entity until then. Does anyone know any workarounds?
public DynamicBuffer<T> AddBuffer<T>(int jobIndex, Entity e) where T : struct, IBufferElementData
EntityCommandBuffer returns the buffer straight away so you can manipulate it in the same job.
1 Like
Ahhh I should be looking more carefully. Thanks, this saved me from having to work out a convoluted hack