Exemplo 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;
    }
Exemplo n.º 2
0
    public void UpdateModel()
    {
        if (this.model == null)
            return;
        if(!this.model.IsLearn())
        {
            skill_level_text.color = Color.gray;
            skill_level_text.text = "未学习";
            skill_image.color = Color.gray;
            skill_info_text.color = Color.gray;

            mask.SetActive(true);
        }
        else
        {
            skill_info_text.color = Color.white;
            skill_image.color = Color.white;
            skill_level_text.color = Color.white;
            skill_level_text.text = model.GetSkillLevel() + "/" + "5";

            mask.SetActive(false);
        }
        skill_info_text.text = model._config.skill_name;   
        skill_image.sprite = model._config.GetSprite();
   
    }