Esempio n. 1
0
    public void SetPopup(MinionBoughtDef.StatNames statId, string currLevelVal, string nextLevelVal, int currLevel)
    {
        _statId = statId;
        var currLevelFloat = float.Parse(currLevel.ToString());

        currLevelFill.fillAmount = currLevelFloat / ShopManager.MAX_MINION_LEVEL;
        currLevelFloat++;
        nextLevelFill.fillAmount = currLevelFloat / ShopManager.MAX_MINION_LEVEL;

        var currInfo = CURR_LEVEL.Replace("%", statId.ToString()) + currLevelVal;
        var nextInfo = NEXT_LEVEL.Replace("%", statId.ToString()) + nextLevelVal;

        if (description.text == "")
        {
            description.text = statId == MinionBoughtDef.StatNames.HP ? ShopManager.HP_STAT_DESC : ShopManager.SPEED_STAT_DESC;
        }
        description.text += '\n';
        description.text += '\n' + currInfo + '\n' + nextInfo;
    }
Esempio n. 2
0
    public void SetItem(int statLvl, float currValue, float nextValue, MinionBoughtDef.StatNames id, int price)
    {
        this.id             = id;
        statName.text       = id.ToString() + " :";
        this.currValue.text = currValue.ToString();
        this.nextValue.text = nextValue.ToString();

        levelBar.fillAmount = float.Parse(statLvl.ToString()) / ShopManager.MAX_MINION_LEVEL;

        buyButton.onClick.AddListener(() => BuyPressed());
        buyButton.GetComponentInChildren <Text>().text = price + " CHIPS";
    }
Esempio n. 3
0
    public string GetMinionUpgradeDescription(string minionType, MinionBoughtDef.StatNames statId)
    {
        MinionType type      = GameUtils.ToEnum(minionType, MinionType.Runner);
        var        list      = new List <string>();
        var        storeData = _storeInfoData[type];
        var        statInfo  = storeData.statsInfo.FirstOrDefault(i => i.type == statId.ToString());

        if (statInfo != null)
        {
            return(statInfo.info);
        }

        return("");
    }