Let’s say I am going to develop a job handle manager, it will have only one instance in the game, then when we do job.Schedule() we must add the job handle to a list in job handle manager, then complete all job handles in the late update, I’m not sure that it is a good approach or not?
public class JobHandleManager {
public static JobHandleManager Instance {get; private set;}
// job handles can be added by other components
public static List jobHandles = new List();
private void Awake() {
Instance = this;
}
There will be jobs you may want to let run until complete, or you may want to complete them but only after the max. allowed 4 frames for TempJob allocator, and there are a number of other ways you may want to handle job completion.
There’s no one size fits all. But if your only jobs always have to be completed by LateUpdate then you could do that sort of JobHandleManager except I’d call it JobCompleter because that’s what it does - it doesn’t “manage” job handles.