示例#1
0
        private void Update()
        {
            if (JobsQueue.Count == 0 && TempJobsQueue.Count == 0)
            {
                return;
            }

            //Taking the jobs one by one as long as we have any jobs
            if (JobsQueue.Count == 0 && TempJobsQueue.Count > 0)
            {
                jobsQueue = new List <TweenJob>(TempJobsQueue);
                TempJobsQueue.Clear();
            }

            while (JobsQueue.Count > 0)
            {
                currentJob = JobsQueue[0];
                JobsQueue.RemoveAt(0);
                if (currentJob == null)
                {
                    continue;
                }

                TempJobsQueue.Add(currentJob);
                currentJob.Work(Time.deltaTime, this);
                currentJob = null;
            }
        }
示例#2
0
        public TweenJob GetJob(int id)
        {
            TweenJob job = JobsQueue.Find(x => x.JobID == id); // look for the job in the active queue

            if (job != null)
            {
                return(job);
            }
            job = TempJobsQueue.Find(x => x.JobID == id); // look in the temp as well
            return(job);
        }
示例#3
0
        public void RemoveJob(int id)
        {
            TweenJob job = JobsQueue.Find(x => x.JobID == id); // look for the job in the active queue

            if (job != null)
            {
                JobsQueue.Remove(job);
            }

            job = TempJobsQueue.Find(x => x.JobID == id); // look in the temp as well
            if (job != null)
            {
                TempJobsQueue.Remove(job);
            }
        }