protected override void OnUpdate() { var commandBuffer = CommandBufferSystem.CreateCommandBuffer(); Dependency = new ScoreBoxCollisionEventJob() { CommandBuffer = commandBuffer, ScoreBoxGroup = GetComponentDataFromEntity <ScoreBox>(true), PlayerGroup = GetComponentDataFromEntity <Player>() } .Schedule(StepPhysicsWorldSystem.Simulation, ref BuildPhysicsWorldSystem.PhysicsWorld, Dependency); Dependency.Complete(); }
protected override void OnUpdate() { var commandBuffer = EndFixedStepSimulationEcbSystem.CreateCommandBuffer(); Dependency = new ScoreBoxCollisionEventJob() { CommandBuffer = commandBuffer, ScoreBoxGroup = GetComponentDataFromEntity <ScoreBox>(true), PlayerGroup = GetComponentDataFromEntity <Player>() } .Schedule(StepPhysicsWorldSystem.Simulation, ref BuildPhysicsWorldSystem.PhysicsWorld, this.Dependency); // Add the job as a dependency EndFixedStepSimulationEcbSystem.AddJobHandleForProducer(this.Dependency); }