protected void LoopChildren(List <ActItem> list) { if (mFinishList.Count >= list.Count) { Exit(); return; } if (list.Count > 0) { for (int i = 0; i < list.Count; i++) { if (mFinishList.Contains(i)) { continue; } ActItem item = list[i]; item.Loop(); if (item.Status == EActStatus.SUCCESS) { mFinishList.Add(i); } } } else { Exit(); } }
public void Execute() { for (int i = 0; i < mRunItems.Count; i++) { ActItem item = mRunItems[i]; item.Loop(); if (item.Status == EActStatus.INITIAL || item.Status == EActStatus.SUCCESS) { mDelItems.Add(item); } } for (int i = 0; i < mDelItems.Count; i++) { ActItem item = mDelItems[i]; mRunItems.Remove(item); } mDelItems.Clear(); for (int i = 0; i < mMovers.Count; i++) { MoverBase mover = mMovers[i]; if (mover.IsDead()) { mDeleteMovers.Add(mover); } else { mover.Execute(); } } for (int i = 0; i < mDeleteMovers.Count; i++) { mMovers.Remove(mDeleteMovers[i]); } }
protected override void ExecuteChildren() { if (Children.Count > 0) { ActItem item = Children[RandomIndex]; item.Loop(); if (item.Status == EActStatus.SUCCESS) { Exit(); } } else { Exit(); } }