コード例 #1
0
 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();
         }
     }
 }
コード例 #2
0
    /// <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);
    }