Example #1
0
    void Update()
    {
        if (isOpen)
        {
            if (cell.owner != startOwner)
            {
                Close();
                return;
            }

            goldUpgrade.gameObject.SetActive(cell.CanBeImproved(ImprovementType.GoldProductionRate));
            unitCapacityUpgrade.gameObject.SetActive(cell.CanBeImproved(ImprovementType.UnitCapacity));
            unitRateUpgrade.gameObject.SetActive(cell.CanBeImproved(ImprovementType.UnitSpawnRate));

            goldUpgrade.GetComponentInChildren <Text> ().text         = cell.GetImprovementCost(ImprovementType.GoldProductionRate).ToString();
            unitCapacityUpgrade.GetComponentInChildren <Text> ().text = cell.GetImprovementCost(ImprovementType.UnitCapacity).ToString();
            unitRateUpgrade.GetComponentInChildren <Text> ().text     = cell.GetImprovementCost(ImprovementType.UnitSpawnRate).ToString();
        }
    }