//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()); } }
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()); } }
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(); } }