Ejemplo n.º 1
0
 public void RemoveJob(TweenJob job)
 {
     if (job != null)
     {
         RemoveJob(job.JobID);
     }
 }
Ejemplo n.º 2
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;
            }
        }
Ejemplo n.º 3
0
        public void AddJob(TweenJob job)
        {
            if (job == null)
            {
                return;
            }

            JobsQueue.Add(job);
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
0
        public bool EndJob(int id)
        {
            TweenJob job = GetJob(id);

            if (job == null)
            {
                return(false);
            }
            job.EndJob();
            RemoveJob(job.JobID);
            return(true);
        }
Ejemplo n.º 6
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);
            }
        }