yyl
22 小时以前 4b5b31a23a74c1559460643836d70778d7d49931
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using UnityEngine;
using UnityEngine.UI;
using System.Collections.Generic;
 
public class HeroAwakeCell : MonoBehaviour
{
    [SerializeField] UIEffectPlayer fireEffect;
    [SerializeField] Image selectImg;
    [SerializeField] Image bgImg;
    [SerializeField] Image attrTypeImg;
    [SerializeField] Text attrText;
    [SerializeField] UIEffectPlayer activeEffect;
    [SerializeField] Text awakeLVText;
    [SerializeField] Image lineImg;
 
 
    public void Display(HeroInfo hero, int awakeLV)
    {
        var config = HeroAwakeConfig.GetHeroAwakeConfig(hero.heroId, awakeLV);
        if (hero.awakeLevel < awakeLV)
        {
            //未激活
            fireEffect.Stop();
            selectImg.SetActive(hero.awakeLevel + 1 == awakeLV);
        }
        else
        {
            fireEffect.Play();
            selectImg.SetActive(false);
        }
 
        //1 天赋 2技能 3属性
        int type = config.UnlockTalentSlot != 0 ? 1 : config.SkillID != 0 ? 2 : 3;
        attrTypeImg.SetSprite("heroattrtype" + type);
        bgImg.SetSprite("heroawakebg" + type);
        if (type == 1)
        {
            attrText.text = UIHelper.AppendColor(hero.awakeLevel >= awakeLV ? TextColType.Green : TextColType.NavyGray, Language.Get("HeroAwake4"), false);
        }
        else if (type == 2)
        {
            attrText.text = UIHelper.AppendColor(hero.awakeLevel >= awakeLV ? TextColType.Green : TextColType.NavyGray, Language.Get("herocard16"), false);
        }
        else
        {
            string attrStr = "";
            for (int i = 0; i < config.AttrIDList.Length; i++)
            {
                attrStr += PlayerPropertyConfig.GetFullDescription(config.AttrIDList[i], config.AttrValueList[i]) +
                    (i == config.AttrIDList.Length - 1 ? "" : "\n");
            }
            attrText.text = UIHelper.AppendColor(hero.awakeLevel >= awakeLV ? TextColType.Green : TextColType.NavyGray, attrStr, false);
        }
        awakeLVText.text = awakeLV.ToString();
        lineImg.SetActive(hero.awakeLevel >= awakeLV);
    }
 
    public void ShowActiveEffect(HeroInfo hero, int awakeLV)
    {
        var config = HeroAwakeConfig.GetHeroAwakeConfig(hero.heroId, awakeLV);
        //1 天赋 2技能 3属性
        int type = config.UnlockTalentSlot != 0 ? 1 : config.SkillID != 0 ? 2 : 3;
        if (type != 3)
            return;
 
        if (hero.awakeLevel + 1 == awakeLV)
        { 
            activeEffect.Play();
        }
    }
}