示例#1
0
 private IEnumerator ExecuteReadyActionsCoroutine()
 {
     while (InitActions.Count > 0)
     {
         InitAction action = InitActions[0];
         if (action.CanBegin())
         {
             action.Initialize(this, m_eventDispatcher);
             InitActions.RemoveAt(0);
             action.Begin();
             if (m_runAsCoroutine)
             {
                 yield return(m_coroutineOwner.StartCoroutine(action.Perform()));
             }
             else
             {
                 CoroutineHelper.RunCoroutineToCompletion(action.Perform());
             }
             yield return(null);
         }
         else if (action.completed)
         {
             InitActions.RemoveAt(0);
         }
     }
 }
示例#2
0
 private IEnumerator ExecuteReadyActionsCoroutine()
 {
     while (InitActions.Count > 0)
     {
         InitAction action = InitActions[0];
         if (action.CanStart())
         {
             action.Initialize(this, m_eventDispatcher, m_configurator);
             Logger.LogDebug(this, "Starting init action: " + action.ActionName, Logger.TagFlags.INIT);
             InitActions.RemoveAt(0);
             action.Start();
             if (m_runAsCoroutine)
             {
                 yield return(BaseGameController.Instance.StartCoroutine(action.Perform()));
             }
             else
             {
                 CoroutineHelper.RunCoroutineToCompletion(action.Perform());
             }
             yield return(null);
         }
     }
 }