少年修仙传客户端代码仓库
client_Wu Xijin
2019-04-28 8d06932ebf186837e048da4822bd837dbf90e212
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
 
namespace Snxxz.UI
{
    public class ExpertSkillConditionCell : CellView
    {
        [SerializeField] Text m_Condition;
        [SerializeField] Text m_Description;
        [SerializeField] Image m_Line;
 
        TreasureSkillModel model { get { return ModelCenter.Instance.GetModel<TreasureSkillModel>(); } }
 
        public void Display(int skillId, int level)
        {
            var skillConfig = SkillConfig.Get(skillId + level - 1);
            var property = skillConfig.RequireProperty();
            var propertyConfig = PlayerPropertyConfig.Get(property);
            m_Condition.text = string.Format("{0}灵根{1}激活", propertyConfig.Name, skillConfig.RequirePropertyValue());
            m_Description.text = skillConfig.Description;
 
            m_Line.gameObject.SetActive(level < skillConfig.SkillMaxLV);
 
            var currentValue = UIHelper.GetPropertyValue((PropertyType)property);
 
            if (currentValue >= skillConfig.RequirePropertyValue())
            {
                m_Description.color = UIHelper.s_LightYellow;
            }
            else
            {
                m_Description.color = UIHelper.s_Gray;
            }
        }
    }
}