Example #1
0
	public void RemoveChildJob(Job childJob)
	{
		if (childrenJobQueue.Contains(childJob) == false)
		{
#if DEBUG_LOG
			Debug.LogWarning("WARNING: Job.RemoveChildJob: this job doesn't contain that child");
#endif
			return ;
		}
		
		Queue<Job> newChildrenJobQueue = new Queue<Job>(childrenJobQueue.Count - 1);
		Job[] allCurrentChildren = childrenJobQueue.ToArray();
		
		for (int i = 0; i < allCurrentChildren.Length; ++i)
		{
			Job j = allCurrentChildren[i];
			if (j != childJob)
			{
				newChildrenJobQueue.Enqueue(j);
			}
		}
		
		childrenJobQueue = newChildrenJobQueue;
	}
Example #2
0
		public void StartDownload()
		{
#if DEBUG_LOG
			Debug.Log("DEBUG: TileEntry.StartDownload: " + url);
#endif
			job = new Job(DownloadCoroutine(), this);
			job.JobComplete += jobCompleteHandler;
		}
Example #3
0
	public void AddChildJob(Job child)
	{
		if (childrenJobQueue == null)
			childrenJobQueue = new Queue<Job>();
		childrenJobQueue.Enqueue(child);
	}
Example #4
0
	public Job CreateAndAddChildJob(IEnumerator coroutine)
	{
		Job j = new Job(coroutine, false);
		AddChildJob(j);
		return j;
	}