protected override void OnUpdate() { var entityCommandBuffer = commandBufferSystem.CreateCommandBuffer(); Dependency = new PickupOnTriggerSystemJob { allPickups = GetComponentDataFromEntity <PickupTag>(true), allPlayers = GetComponentDataFromEntity <PlayerTag>(), ecb = entityCommandBuffer }.Schedule(stepPhysicsWorld.Simulation, Dependency); Dependency.Complete(); commandBufferSystem.AddJobHandleForProducer(this.Dependency); }
protected override JobHandle OnUpdate(JobHandle inputDependencies) { var job = new PickupOnTriggerSystemJob(); job.allPickups = GetComponentDataFromEntity <PickupTag>(true); job.allPlayers = GetComponentDataFromEntity <PlayerTag>(true); job.entityCommandBuffer = commandBufferSystem.CreateCommandBuffer(); JobHandle jobHandle = job.Schedule(stepPhysicsWorld.Simulation, ref buildPhysicsWorld.PhysicsWorld, inputDependencies); //jobHandle.Complete(); commandBufferSystem.AddJobHandleForProducer(jobHandle); return(jobHandle); }