Exemplo n.º 1
0
 //called when the maximum population slots are updated
 public void OnMaxPopulationUpdated(FactionSlot factionSlot, int value)
 {
     //if this update belongs to the faction managed by this component:
     if (factionSlot.FactionMgr.FactionID == factionMgr.FactionID)
     {
         UpdateTargetAmount(factionSlot.GetMaxPopulation());
     }
 }
Exemplo n.º 2
0
 public void OnMaxPopulationUpdated(FactionSlot factionSlot, int value)
 {
     //if this update belongs to the faction managed by this component:
     if (factionSlot.FactionMgr.FactionID == factionMgr.FactionID)
     {
         maxPopulation = factionSlot.GetMaxPopulation();
         CheckFreePopulationSlots(factionSlot.GetFreePopulation());
     }
 }
Exemplo n.º 3
0
        private Text populationText = null; //a text that shows the faction's population

        //a method that allows to update the population UI count
        private void UpdatePopulationUI(FactionSlot factionSlot, int value)
        {
            if (factionSlot.PlayerControlled) //only if this is the local player's faction
            {
                populationText.text = factionSlot.GetCurrentPopulation().ToString() + "/" + factionSlot.GetMaxPopulation().ToString();
            }
        }