Exemple #1
0
 public static CoroutineTaskState CreateTask(IEnumerator coroutine)
 {
     if (singleton == null)
     {
         GameObject go = new GameObject("CoroutineTaskManager");
         singleton = go.AddComponent <CoroutineTaskManager>();
     }
     return(new CoroutineTaskState(coroutine));
 }
Exemple #2
0
 /// <summary>
 /// Creates a new CoroutineTask object for the given coroutine.
 ///
 /// If autoStart is true (default) the coroutine is automatically started
 /// upon construction.
 /// </summary>
 public CoroutineTask(IEnumerator c, bool autoStart = true)
 {
     task           = CoroutineTaskManager.CreateTask(c);
     task.Finished += TaskFinished;
     if (autoStart)
     {
         Start();
     }
 }