public void ForeachEntities(GCContainer rGCContainer, Action <GCContainer> rExecuteComponents, params Type[] rTypes) { if (rTypes.Length == 0) { return; } for (int i = 0; i < mEntities.Count; i++) { var rEntity = mEntities[i]; rGCContainer.Clear(); bool bIsIgnore = false; for (int k = 0; k < rTypes.Length; k++) { var rComp = rEntity.Components.Find((rItem) => { return(rItem.GetType().Equals(rTypes[k])); }); if (rComp == null) { bIsIgnore = true; break; } rGCContainer.Add(rComp); } if (!bIsIgnore) { UtilTool.SafeExecute(rExecuteComponents, rGCContainer); } } }
public void ForeachEntities(GCContainer rGCContainer, Action <GCContainer> rExecuteComponents, params Type[] rTypes) { rGCContainer.Clear(); for (int i = 0; i < mEntities.Count; i++) { var rEntity = mEntities[i]; for (int k = 0; k < rTypes.Length; k++) { var rComp = rEntity.Components.Find((rItem) => { return(rItem.GetType().Equals(rTypes[k])); }); rGCContainer.Add(rComp); } } UtilTool.SafeExecute(rExecuteComponents, rGCContainer); }
public virtual void Initialize() { this.IsActive = true; this.mResultComps = new GCContainer(); }