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); }
/// <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); }