void UpdateText() { level.sprite = SpriteHandler.GetPipsSprite(Technology.lvl); timeCost.text = Technology.curTime.ToString("N1"); scienceCost.text = Technology.curScience.ToString("N1"); if (Technology.lvl == Technology.lvlmax) { timeCost.gameObject.SetActive(false); scienceCost.gameObject.SetActive(false); } }
public override void Init(object reg) { BaseRegiment = (BaseRegiment)reg; gameObject.SetActive(true); icon.sprite = BaseRegiment.Icon; for (int i = 0; i < 3; i++) { ArmPips[i].sprite = SpriteHandler.GetPipsSprite(BaseRegiment.ArmorLvl((DamageType)i)); } DamPips.sprite = SpriteHandler.GetPipsSprite(BaseRegiment.damageLvl); name.text = BaseRegiment.type.ToString(); descr.text = $"Стоимость {BaseRegiment.cost.ToArmyCost()}\nСодержание {BaseRegiment.upkeep.ToArmyCost()}\nВремя {BaseRegiment.time}"; bye.onClick.RemoveAllListeners(); if (Player.PlayerCheckRegion()) { bye.onClick.AddListener(() => RecruitMenu.AddToQueue(BaseRegiment)); } CheckCost(); }