using UnityEngine; using UnityEngine.UI; using System; namespace vnxbqy.UI { public class EquipTypeCell : MonoBehaviour { [SerializeField] Image equipImg; [SerializeField] Image bgImg; [SerializeField] Text nameText; [SerializeField] Button typeBtn; int equipIndex = 0; ItemCompoundConfig itemCompound; ComposeWinModel composeModel { get { return ModelCenter.Instance.GetModel(); } } public void SetDisplay(int _equipIndex,ItemCompoundConfig _itemCompound) { this.equipIndex = _equipIndex; this.itemCompound = _itemCompound; int itemId = _itemCompound.makeID[0]; ItemConfig itemConfig = ItemConfig.Get(itemId); if (itemConfig == null) return; equipImg.SetSprite(itemConfig.IconKey); bgImg.SetItemBackGround(itemConfig.ItemColor, itemConfig.QualityEchoType); nameText.text = GeneralDefine.equipPlaceNameDict[itemConfig.EquipPlace]; typeBtn.RemoveAllListeners(); typeBtn.AddListener(ClickTypeBtn); } private void ClickTypeBtn() { composeModel.UpdateComposeEquipPlace(itemCompound,equipIndex); } } }