protected override JobHandle OnUpdate(JobHandle inputDeps) { var Array = m_Query.ToComponentDataArray <BuildUltraChunkEvent>(Allocator.TempJob); var toBuild = Array[0]; Array.Dispose(); BuildUltraChunks buildUltraChunks = new BuildUltraChunks { archetype = archetype, commandBuffer = endSimulationEntityCommandBufferSystem.CreateCommandBuffer(), position = toBuild.positionToBuild, eventEntity = toBuild.eventEntity }; inputDeps = buildUltraChunks.Schedule(inputDeps); endSimulationEntityCommandBufferSystem.AddJobHandleForProducer(inputDeps); return(inputDeps); }