using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
using vnxbqy.UI;
|
|
|
namespace EnhancedUI.EnhancedScroller
|
{
|
|
public class GodWeaponCell : CellView
|
{
|
[SerializeField] Text m_Level;
|
[SerializeField] RectTransform m_ContainerUnlock;
|
[SerializeField] Text m_Condition;
|
[SerializeField] Image m_SelectBottom;
|
[SerializeField] Image m_Icon;
|
[SerializeField] Text m_GodWeaponName;
|
[SerializeField] RedpointBehaviour m_Redpoint;
|
|
MagicianModel m_Model;
|
MagicianModel model
|
{
|
get
|
{
|
return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<MagicianModel>());
|
}
|
}
|
public void Display(int _type)
|
{
|
m_SelectBottom.SetSprite(model.selectType == _type ? "ListBtn_Select" : "ListBtn_UnSelect");
|
var config = GodWeaponConfig.GetConfig(_type, 1);
|
m_GodWeaponName.text = config.Name;
|
var godWeaponInfo = model.GetGodWeaponInfo(_type);
|
m_Level.SetActive(godWeaponInfo != null && godWeaponInfo.level >= 1);
|
m_Level.text = StringUtility.Contact(godWeaponInfo.level, Language.Get("L1047"));
|
m_ContainerUnlock.SetActive(godWeaponInfo == null || godWeaponInfo.level < 1);
|
m_Redpoint.redpointId = MagicianModel.MAGICAIN_REDPOINT * MagicianModel.MAGICAIN_INTERVAL + _type;
|
|
if (!model.IsGodWeaponUnlock(_type))
|
{
|
bool satisfyCondition = model.ContainsCondition(_type) && model.SatisfyUnlockCondition(_type);
|
m_Condition.text = satisfyCondition ? Language.Get("GodWeaponUnActive") : Language.Get("MagicWin_1");
|
}
|
if (model.godWeaponIcons.ContainsKey(_type))
|
{
|
m_Icon.SetSprite(model.godWeaponIcons[_type]);
|
m_Icon.SetNativeSize();
|
}
|
}
|
}
|
}
|
|