#Using CommandBuffers from unmanaged systems

1 messages · Page 1 of 1 (latest)

split bear
#

I want to use the CommandBuffer at the end of the initialization group in an unmanaged system. How should I do this?

Incorrect solution:

[UpdateInGroup(typeof(InitializationSystemGroup))]
public partial struct GameStateSystem : ISystem, ISystemStartStop
{
    private EndInitializationEntityCommandBufferSystem bufferSystem;

    void ISystem.OnCreate(ref SystemState state) => bufferSystem =
        state.World.GetOrCreateSystemManaged<EndInitializationEntityCommandBufferSystem>();