protected override JobHandle OnUpdate(JobHandle inputDeps) { // destroyActorOutsA.Clear(); destroyActorOutsB.Clear(); destroyActors.Clear(); inputDeps = new GetDestroyActorJobA { destroyActorOuts = destroyActorOutsA.AsParallelWriter(), } .Schedule(this, inputDeps); inputDeps = new GetDestroyActorJobB { destroyActorOuts = destroyActorOutsB.AsParallelWriter(), } .Schedule(this, inputDeps); inputDeps = NativeQueueEx.ToListJob(destroyActorOutsA, destroyActorOutsB, ref destroyActors, inputDeps); inputDeps = new DestroyVisibleDistanceJob { destroyActors = destroyActors.AsDeferredJobArray(), } .Schedule(this, inputDeps); return(inputDeps); }
protected override JobHandle OnUpdate(JobHandle inputDeps) { outAs.Clear(); outBs.Clear(); ins.Clear(); var inputDepsA = new WeaponOnMessageJobA { outs = outAs.AsParallelWriter(), } .Schedule(this, inputDeps); var inputDepsB = new WeaponOnMessageJobB { outs = outBs.AsParallelWriter(), } .Schedule(this, inputDeps); inputDeps = NativeQueueEx.ToListJob(outAs, outBs, ref ins, JobHandle.CombineDependencies(inputDepsA, inputDepsB)); inputDeps = new SyncWeaponInstalledStateJob { ins = ins.AsDeferredJobArray(), } .Schedule(this, inputDeps); return(inputDeps); }