using UnityEngine;
|
using UnityEngine.UI;
|
using Snxxz.UI;
|
|
|
public class EquipWashCell : MonoBehaviour
|
{
|
[SerializeField] public Button cellToggle;
|
[SerializeField] public ItemCell itemCell;
|
[SerializeField] public Text nameText;
|
[SerializeField] public Text washLevelText;
|
[SerializeField] public GameObject noEquipGo;
|
[SerializeField] public Text placeText;
|
[SerializeField] public Text isPutOnText;
|
[SerializeField] GameObject unSelectImg;
|
[SerializeField] GameObject selectImg;
|
|
[SerializeField] public RedpointBehaviour washRedpoint;
|
|
PlayerPackModel playerPack{get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); }}
|
EquipWashModel equipWashModel {get{return ModelCenter.Instance.GetModel<EquipWashModel>();}}
|
|
public void SetDisplayModel(WashProCount washPro, int repointId, int index, int selectIndex)
|
{
|
ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.Equip, washPro.EquipPlace);
|
var washModel = EquipWashConfig.GetEquipWashData(equipWashModel.OnGetWashType(washPro.EquipPlace), washPro.XLAttrLV);
|
washRedpoint.redpointId = repointId;
|
if (itemModel != null && washModel != null)
|
{
|
itemCell.gameObject.SetActive(true);
|
nameText.gameObject.SetActive(true);
|
washLevelText.gameObject.SetActive(true);
|
noEquipGo.SetActive(false);
|
nameText.text = UIHelper.AppendStringColor(itemModel.config.ItemColor, itemModel.config.ItemName, true);
|
//pdr ToDo
|
itemCell.Init(itemModel);
|
washLevelText.text = equipWashModel.GetCurWashLvStr(washPro, washModel.washConfig);
|
}
|
else
|
{
|
itemCell.gameObject.SetActive(false);
|
nameText.gameObject.SetActive(false);
|
washLevelText.gameObject.SetActive(false);
|
noEquipGo.SetActive(true);
|
placeText.text = StringUtility.Contact(Language.Get("EquipWin_PartTitleText_1"), UIHelper.GetEquipPlaceName(washPro.EquipPlace));
|
isPutOnText.text = Language.Get("StrengtheningPanel_DownText_1");
|
}
|
|
if(index == selectIndex)
|
{
|
selectImg.SetActive(true);
|
unSelectImg.SetActive(false);
|
}
|
else
|
{
|
selectImg.SetActive(false);
|
unSelectImg.SetActive(true);
|
}
|
|
}
|
|
}
|