Esempio n. 1
0
    public void UpdateModel()
    {
        if (model == null)
        {
            return;
        }
        intro_text.text = model._config.skill_des.Replace("t", "<color=#FF9A00>" + (int)model.GetHurtValue() + "</color>");
        double needMoney = 0;

        if (!model.IsLearn())
        {
            needMoney = model.GetLearnMoney();
            level_up_button.GetComponentInChildren <Text>().text = "学习";
            level_up_info_text.text = "学习需要金钱:" + ((ActorModel.Model.GetMoney() >= needMoney) ? "<color=green>" : "<color=red>") + needMoney + "</color>";
        }
        else
        {
            needMoney = model.GetLevelUpMoney();
            level_up_button.GetComponentInChildren <Text>().text = "升级";
            level_up_info_text.text = DreamerUtil.GetColorRichText("\t\t等级:" + model.GetSkillLevel(), Color.white) + "\n升级所需金钱: " + ((ActorModel.Model.GetMoney() >= needMoney) ? "<color=green>" : "<color=red>") + needMoney + " </color>";
        }

        level_up_button.interactable = ActorModel.Model.GetMoney() >= needMoney;
        level_up_button.GetComponentInChildren <Text>().color = ActorModel.Model.GetMoney() >= needMoney ? Color.yellow : Color.gray;
    }
Esempio n. 2
0
    public void UpdateModel()
    {
        skill_info.text = m_model._config.skill_des.Replace("t", "<color=#FF9A00>" + (int)m_model.GetHurtValue() + "</color>");;
        if (m_model.IsLearn())
        {
            SetButtons(true);


            for (int i = 0; i < m_skill_button.Length; i++)
            {
                if (ActorModel.Model.equip_skil[i] == m_model)
                {
                    m_skill_button[i].gameObject.SetActive(false);
                }
            }
        }
        else
        {
            SetButtons(false);
        }
    }