Hello all, in ISystem systems I am able to obtain Entity Command Buffer by typing:
var ecb = SystemAPI.GetSingleton<BeginInitializationEntityCommandBufferSystem.Singleton>().CreateCommandBuffer(state.WorldUnmanaged);
SystemBase systems do not have SystemState state parameter on it’s methods and I was able to obtain ECB by these codes:
1) var ecb = World.GetOrCreateSystemManaged<BeginSimulationEntityCommandBufferSystem>().CreateCommandBuffer();
2) var ecb = SystemAPI.GetSingleton<BeginSimulationEntityCommandBufferSystem.Singleton>().CreateCommandBuffer(World.Unmanaged);
Are both of these options valid in SystemBase, or is some of them preferred? Or should I choose something entirely different?
Thanks in advance for your answers!