/// <summary> /// 等待所有的<see cref="TaskUpdate"/>完成 /// </summary> private void WaitTaskUpdate() { for (int iTask = 0; iTask < m_TaskItemsCache.Count; iTask++) { TaskUpdateItem taskItem = m_TaskItemsCache[iTask]; taskItem.ManualResetEvent.WaitOne(); BaseBehaviour iterBehaviour = taskItem.Behaviour; try { MDebug.LogVerbose("Core" , $"Before execute {iterBehaviour.GetName()}.OnAfterTaskUpdate"); iterBehaviour.OnAfterTaskUpdate(taskItem.Output); MDebug.LogVerbose("Core" , $"After execute {iterBehaviour.GetName()}.OnAfterTaskUpdate"); } catch (Exception e) { MDebug.LogError("Core" , $"Execute {iterBehaviour.GetName()}.OnAfterTaskUpdate Exception:{e.ToString()}"); } m_TaskItemPool.Release(taskItem); } m_TaskItemsCache.Clear(); }