コード例 #1
0
        public List <GameObject> FindAll(Func <GameObject, bool> del)
        {
            List <GameObject> result = new List <GameObject>();

            if (del.Invoke(onTile))
            {
                result.Add(onTile);
            }

            result.AddRange(onTile.FindAll(del));
            return(result);
        }
コード例 #2
0
        /// <summary>
        /// Find all children with a given condition
        /// </summary>
        /// <param name="del">The function to filter results with</param>
        /// <returns>All children to which "del" applies</returns>
        public virtual List <GameObject> FindAll(Func <GameObject, bool> del)
        {
            List <GameObject> result = new List <GameObject>();

            if (inventory != null)
            {
                result.AddRange(inventory.FindAll(del));
            }
            if (equipmentSlots != null)
            {
                result.AddRange(equipmentSlots.FindAll(del));
            }
            if (skillList != null)
            {
                result.AddRange(skillList.FindAll(del));
            }
            return(result);
        }