コード例 #1
0
 public JobExecution(IJobDisposable job, JobHandle handle, OnJobComplete onJobComplete, bool completeInLateUpdate, string jobTag)
 {
     this.Job                  = job;
     this.Handle               = handle;
     this.OnJobComplete        = onJobComplete;
     this.CompleteInLateUpdate = completeInLateUpdate;
     this.JobTag               = jobTag != null ? jobTag : GetHashCode().ToString();
     this.JobWorking           = true;
 }
コード例 #2
0
    JobExecution AddJob(IJobDisposable job, JobHandle handle, OnJobComplete onJobComplete, bool completeImmediatelly = false, string tag = null)
    {
        JobExecution execution = new JobExecution(job, handle, onJobComplete, completeImmediatelly, tag);

        this._scheduledJobs.Add(execution);
        if (DebugLog)
        {
            Debug.LogFormat("Job {0} has been scheduled and waiting for completion.", execution.JobTag);
        }
        return(execution);
    }
コード例 #3
0
 /// <summary>
 /// Adds scheduled job to the system.
 /// </summary>
 /// <param name="job">IJobDisposable</param>
 /// <param name="handle">Job Handle with scheduled job</param>
 /// <param name="onJobComplete">Delegate which is invoked after job is completed</param>
 /// <param name="completeImmediatelly">Complete this job immediately in the next LateUpdate() call?</param>
 public static JobExecution AddScheduledJob(IJobDisposable job, JobHandle handle, OnJobComplete onJobComplete, bool completeImmediatelly = false, string tag = null)
 {
     return(JobHelper.GetInstance().AddJob(job, handle, onJobComplete, completeImmediatelly, tag));
 }