Пример #1
0
    bool OnGeneralSelectChange(int index)
    {
        generalIndex = index;
        generalInfo  = Informations.Instance.GetGeneralInfo(index);

        kingPopupList.SetItemSelect(generalInfo.king);
        cityPopupList.SetItemSelect(generalInfo.city);
        weaponPopupList.SetItemSelect(generalInfo.equipment);
        magicPopupList.SetItemSelect(-1);

        sliderLevel.value     = generalInfo.level / 50f;
        sliderStrength.value  = generalInfo.strength / 120f;
        sliderIntellect.value = generalInfo.intellect / 120f;
        sliderHealthy.value   = generalInfo.healthCur / 200f;
        sliderMana.value      = generalInfo.manaCur / 200f;
        sliderSoldier.value   = (generalInfo.soldierCur + generalInfo.knightCur) / 100f;

        for (int i = 0; i < 4; i++)
        {
            if (generalInfo.magic[i] == -1)
            {
                labelMagic[i].text = "";
            }
            else
            {
                labelMagic[i].text = ZhongWen.Instance.GetMagicName(generalInfo.magic[i]);
            }
        }

        return(true);
    }
Пример #2
0
    bool OnCitySelectChange(int index)
    {
        cityIndex = index;
        cityInfo  = Informations.Instance.GetCityInfo(index);

        kingPopupList.SetItemSelect(cityInfo.king);

        sliderMoney.value      = cityInfo.money / 999999f;
        sliderPopulation.value = cityInfo.population / 999999f;
        sliderDefense.value    = cityInfo.defense / 999f;
        sliderReservist.value  = cityInfo.reservist / 999f;

        return(true);
    }