Esempio n. 1
0
        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);
                }
            }
        }
Esempio n. 2
0
 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);
 }