public void AddWardrobeGroup() { WardrobeGroup newGroup = new WardrobeGroup(); wardrobeGroups.Add(newGroup); int w = wardrobeGroups.Count; for (int o = 0; o < orphanWardrobe.Count; o++) { if (orphanWardrobe[o].activeSelf) { wardrobeGroups[w].wardrobe.Add(orphanWardrobe[o]); } } for (int p = 0; p < wardrobeParents.Count; p++) { foreach (Transform child in wardrobeParents[p].transform) { if (child.gameObject.activeSelf) { wardrobeGroups[w].wardrobe.Add(child.gameObject); } } } }
public int CountThisObjectInGroup(GameObject go, WardrobeGroup g) { int count = 0; for (int i = 0; i < g.wardrobe.Count; i++) { if (g.wardrobe[i].gameObject == go) { count++; } } return(count); }