Give Page Feedback | API

Secondary Non Components - Yield Until Job Complete

A special wrapper for a Unity YieldInstruction that can be used with methods that have a return type of IEnumerator. You can use this in conjunction with Job code to tell the method that is driving the enumerator methods execution to yield until the Job is complete. Jobs can be used to easily parallelize code.

When you yield return an instance of YieldUntilJobComplete within a method that is being driven by the World, the World will automatically create a copy of the jobHandle and use that until the job is complete. This means you should be able to safely reuse the YieldUntilJobComplete instance immediately, so long as you assign a new Job Handle to it each time it is used.