using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { public class WashMasterCell : MonoBehaviour { [SerializeField] CommonItemBaisc itemBaisc; [SerializeField] RoleEquipType equipPlace = RoleEquipType.retMax; [SerializeField] Text washDesText; PackModel playerPack { get { return ModelCenter.Instance.GetModel(); } } ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel(); } } EquipWashModel washModel { get { return ModelCenter.Instance.GetModel(); } } public void SetModel(int masterLv) { ItemModel itemModel = playerPack.GetItemByIndex(PackType.Equip,(int)equipPlace); if(itemModel == null) { itemBaisc.gameObject.SetActive(false); washDesText.text = UIHelper.AppendStringColor(TextColType.Red, Language.Get("EquipSuitPanel_IsPutOnText_1")); } else { itemBaisc.gameObject.SetActive(true); itemBaisc.Init(itemModel); itemBaisc.cellBtn.RemoveAllListeners(); itemBaisc.cellBtn.AddListener(()=> { tipsModel.SetItemTipsModel(PackType.Equip,itemModel.guid); }); int curLv = 1; WashProCount washPro = washModel.GetWashEquipInfo((int)equipPlace); if (washPro != null) { curLv = washPro.XLAttrLV; } if (masterLv != -1) { if (curLv >= masterLv) { washDesText.text = Language.Get("EquipWash119", StringUtility.Contact(UIHelper.AppendStringColor(TextColType.Green, curLv.ToString()), "/", masterLv)); } else { washDesText.text = Language.Get("EquipWash119", StringUtility.Contact(UIHelper.AppendStringColor(TextColType.Red, curLv.ToString()), "/", masterLv)); } } else { washDesText.text = Language.Get("EquipWash119", StringUtility.Contact(UIHelper.AppendStringColor(TextColType.Green, curLv.ToString()))); } } } } }