Пример #1
0
    public void CalculateStatPoint()
    {
        // Calculate bonus stat
        int totalStats = (DataManager.Instance.clientPlayerData.Stat[(int)OperationBluehole.Content.StatType.Lev] - 1) * OperationBluehole.Content.Config.BONUS_STAT_PER_LEVEL + OperationBluehole.Content.Config.CHARACTER_BASE_STATS.Skip(1).Take(6).Sum(i => i);
        int curStats   = DataManager.Instance.clientPlayerData.Stat.Skip(1).Take(6).Sum(i => i);

        BonusStatPoint = totalStats - curStats;

        if (BonusStatPoint > 0)
        {
            // Change text
            BonusStatPointLabelText.text = BonusStatPoint.ToString();

            // Show Statup Button
            for (int i = 1; i < increasedStats.Length; ++i)
            {
                statUpButton[i - 1].SetActive(true);
            }
            applyButton.SetActive(true);
        }
        else
        {
            BonusStatPointLabelText.text = "";
        }
    }
Пример #2
0
    public void UseBonusStatPoint()
    {
        if (--BonusStatPoint <= 0)
        {
            for (int i = 1; i < increasedStats.Length; ++i)
            {
                statUpButton[i - 1].SetActive(false);
            }
        }

        // refresh view
        BonusStatPointLabelText.text = BonusStatPoint.ToString();
    }