public void EmptyAllEntries() { for (int i = 0; i < listContainer.childCount; i++) { Transform entry = listContainer.GetChild(i); BattleResolutionRemainingTroopListEntry entryScript = entry.GetComponent <BattleResolutionRemainingTroopListEntry>(); if (entryScript) { entryScript.remainingFieldBtns.MinimizeField(); } } }
/// <summary> /// returns a troopNumberPair list with entries using the provided amounts /// </summary> /// <returns></returns> public TroopList BakeIntoArmy() { TroopList returnedList = new TroopList(); for (int i = 0; i < listContainer.childCount; i++) { Transform entry = listContainer.GetChild(i); BattleResolutionRemainingTroopListEntry entryScript = entry.GetComponent <BattleResolutionRemainingTroopListEntry>(); if (entryScript) { returnedList.Add(entryScript.BakeIntoNewPair()); } } return(returnedList); }