Пример #1
0
        private void RecycleTask(CoroutineTask task)
        {
            Log.I(this, "Recycle coroutine task [{0}]", task.name);
            task.Dispose();

            tasks.Remove(task);
        }
Пример #2
0
 public void CheckAndRecycleTask(CoroutineTask task)
 {
     if (CheckTask(task))
     {
         RecycleTask(task);
     }
 }
Пример #3
0
        public CoroutineTask Execute(CoroutineTask task)
        {
            if (task.GetMonoBehaviour() == null)
            {
                task.SetMonoBehaviour(CoroutineTaskExecutor.instance);
            }
            tasks.Add(task);

            task.ExecuteInternal();
            return(task);
        }
Пример #4
0
 private bool CheckTask(CoroutineTask task)
 {
     return(task != null && task.ShouldRecycle() && !task.isRecycled);
 }
Пример #5
0
 public static void CheckAndRecycle(CoroutineTask task)
 {
     CoroutineTaskManager.instance.CheckAndRecycleTask(task);
 }