protected override JobHandle OnUpdate(JobHandle inputDeps) { using (var commandBuffer = new EntityCommandBuffer(Allocator.TempJob)) { inputDeps = new ShipDestroyMessageJob { OnDestroyMessage = typeof(OnDestroyMessage), Weapon_OnShipDestroyMessage = typeof(Weapon_OnShipDestroyMessage), Player_OnShipDestroyMessage = typeof(Player_OnShipDestroyMessage), commandBuffer = commandBuffer.ToConcurrent(), endCommandBuffer = endBarrier.CreateCommandBuffer().ToConcurrent(), playerFromEntity = GetComponentDataFromEntity <Player>(true), } .Schedule(this, inputDeps); inputDeps.Complete(); commandBuffer.Playback(EntityManager); } return(inputDeps); }