EntityCommandBuffer and Entity initialization

I started to use EntityCommandBuffer for entity instantiation.
I can create entities and add some components without the problem.

But my question is how to do some kind of initialization.
Lets say I have got InitializationComponent.Initialize() on Entity and I would like it to be called right after my Entity is instantiated. (End I mean instantiated in the world not in the ECB).
I would need some kind of callback etc.

You can examine my setup here to get a reference.

1 Like

I have a RequiresInit component on the spawned entity. A system catches this component in the InitializationSystemGroup, sets it up as needed, and then removes or disables the RequiresInit component.

Not sure if this is the quintessential way, since I don’t really like having to write separate Init systems for such a large category of my components, but it’s fine.