public void UpdateDone() { if (idCount > 0) { for (int i = 0; i < idCount; ++i) { workers[i].UpdateDone(); } } if (tmpCount > 0) { for (int i = 0; i < tmpCount;) { UnityCbTaskExecutor tmp = tmpExecutors[i]; if (tmp.UpdateDone()) { tmpExecutors.RemoveAt(i); tmpCount--; } else { ++i; } } } }
private UnityCbTaskExecutor GetTempWorker() { UnityCbTaskExecutor we = new UnityCbTaskExecutor("tmp", true, true); tmpExecutors.Add(we); ++tmpCount; return(we); }
private UnityCbTaskExecutor GetWorker(int id, bool autoShutDown = false) { for (int i = 0; i < idCount; ++i) { if (workers[i].Id == id) { return(workers[i]); } } UnityCbTaskExecutor we = new UnityCbTaskExecutor(id.ToString(), true, autoShutDown) { Id = id }; workers.Add(we); ++idCount; return(we); }