hch
7 天以前 cd60df758226a378ee1c0372568507d32f2f8696
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
using UnityEngine;
using UnityEngine.UI;
 
//羁绊模块
public class HeroConnectionCell : MonoBehaviour
{
    [SerializeField] HeroConnectionHeadCell[] heros;
    [SerializeField] Text connAttrText;
 
    /// <summary>
    /// 羁绊图片展示
    /// </summary>
    /// <param name="fetterID"></param>
    /// <param name="showStr">属性文字排版</param>
    /// <param name="showCollect">是否按收集显示置灰状态</param>
    /// <param name="guid">切换皮肤用</param>
    public void Display(int fetterID, string showStr = "", bool showCollect = false, string guid = "")
    {
        HeroFetterConfig heroFetterConfig = HeroFetterConfig.Get(fetterID);
 
        int fromHeroID = 0;
        int _skinID = 0;
        if (guid != "")
        {
            fromHeroID = HeroManager.Instance.GetHero(guid).heroId;
            _skinID = HeroManager.Instance.GetHero(guid).SkinID;
        }
        for (int i = 0; i < heros.Length; i++)
        {
            if (i < heroFetterConfig.HeroIDList.Length)
            {
                heros[i].SetActive(true);
                heros[i].Display(heroFetterConfig.HeroIDList[i], i, showCollect,
                fromHeroID == heroFetterConfig.HeroIDList[i] ? _skinID : 0);
            }
            else
            {
                heros[i].SetActive(false);
            }
        }
        string attrStr = "";
        for (int i = 0; i < heroFetterConfig.AttrIDList.Length; i++)
        {
            attrStr += PlayerPropertyConfig.GetFullDescription(heroFetterConfig.AttrIDList[i], heroFetterConfig.AttrValueList[i]) + " ";
        }
        if (string.IsNullOrEmpty(showStr))
        {
            connAttrText.text = Language.Get("L1100", heroFetterConfig.FetterName, UIHelper.AppendColor(TextColType.lightYellow, attrStr));
        }
        else
        {
            connAttrText.text = showStr + attrStr;
        }
    }
}