using vnxbqy.UI;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
public class EquipEvolveCell : ILBehaviour
|
{
|
ItemCell itemCell;
|
Text equipName;
|
Text equipState;
|
Button selectEquip;
|
Image selectImage;
|
|
EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } }
|
PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
|
protected override void Awake()
|
{
|
selectEquip = proxy.GetWidgtEx<Button>("EquipSelect");
|
equipName = proxy.GetWidgtEx<Text>("Txt_Name");
|
equipState = proxy.GetWidgtEx<Text>("Txt_Rate");
|
itemCell = proxy.GetWidgtEx<ItemCell>("ItemCell");
|
selectImage = proxy.GetWidgtEx<Image>("selectImage");
|
}
|
|
public void Display(int place)
|
{
|
var level = EquipEvolveModel.Instance.selectLevelType;
|
var position = new Int2(level, place);
|
var equipGuid = equipModel.GetEquip(position);
|
selectImage.SetActiveIL(EquipEvolveModel.Instance.selectPlaceType == place);
|
selectEquip.SetListener(() => {
|
EquipEvolveModel.Instance.selectPlaceType = place;
|
});
|
|
if (string.IsNullOrEmpty(equipGuid))
|
{
|
itemCell.SetActiveIL(false);
|
equipName.text = Language.Get("L1076", UIHelper.GetEquipPlaceName(place));
|
equipName.color = UIHelper.GetUIColor(TextColType.NavyBrown, true);
|
equipState.text = Language.Get("EquipSuitPanel_IsPutOnText_1");
|
equipState.color = UIHelper.GetUIColor(TextColType.Red, true);
|
return;
|
}
|
var item = packModel.GetItemByGuid(equipGuid);
|
if (item == null)
|
return;
|
itemCell.SetActiveIL(true);
|
equipName.text = item.config.ItemName;
|
equipName.color = UIHelper.GetUIColor(item.config.ItemColor, true);
|
equipState.text = string.Empty;
|
|
|
var model = new ItemCellModel(item.itemId, false, (ulong)item.count);
|
itemCell.Init(model);
|
|
}
|
|
}
|