cancellationToken | Optional cancellation token. |
Resumes execution on the next frame.
async Awaitable SampleSchedulingJobsForNextFrame() { // Wait until end of frame to avoid competing over resources with other Unity subsystems await Awaitable.EndOfFrameAsync(); var jobHandle = ScheduleSomethingWithJobSystem(); // Let the job execute while the next frame starts await Awaitable.NextFrameAsync(); jobHandle.Complete(); // Use results of computation }
JobHandle ScheduleSomethingWithJobSystem() { ... }