| 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; | 
|         } | 
|     } | 
| } |