public void Recruit()
 {
     if (this.m_charShipmentRec.GarrFollowerID > 0)
     {
         TroopSlot   troopSlot            = null;
         TroopSlot[] componentsInChildren = this.m_troopSlotsRootObject.GetComponentsInChildren <TroopSlot>(true);
         int         num = 0;
         while (num < (int)componentsInChildren.Length)
         {
             TroopSlot troopSlot1 = componentsInChildren[num];
             if (!troopSlot1.IsEmpty())
             {
                 num++;
             }
             else
             {
                 troopSlot = troopSlot1;
                 break;
             }
         }
         if (troopSlot == null)
         {
             return;
         }
         troopSlot.SetPendingCreate();
         this.UpdateRecruitButtonState();
     }
     LegionCompanionWrapper.CreateShipment(this.m_charShipmentRec.ID, 1);
     Main.instance.m_UISound.Play_RecruitTroop();
 }
示例#2
0
 public void Recruit()
 {
     if (this.m_charShipmentRec.GarrFollowerID > 0)
     {
         TroopSlot   troopSlot            = null;
         TroopSlot[] componentsInChildren = this.m_troopSlotsRootObject.GetComponentsInChildren <TroopSlot>(true);
         foreach (TroopSlot troopSlot2 in componentsInChildren)
         {
             if (troopSlot2.IsEmpty())
             {
                 troopSlot = troopSlot2;
                 break;
             }
         }
         if (troopSlot == null)
         {
             return;
         }
         troopSlot.SetPendingCreate();
         this.UpdateRecruitButtonState();
     }
     LegionCompanionWrapper.CreateShipment(this.m_charShipmentRec.ID, 1);
     Main.instance.m_UISound.Play_RecruitTroop();
 }