using Snxxz.UI;
|
using System.Collections;
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
using System;
|
|
namespace EnhancedUI.EnhancedScroller
|
{
|
public class ImpactRankPromoteCell : ScrollerUI
|
{
|
[SerializeField] WayCell[] m_WayCells;
|
|
ImpactRankModel m_Model;
|
ImpactRankModel model
|
{
|
get
|
{
|
return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<ImpactRankModel>());
|
}
|
}
|
|
DailyQuestModel _questModel;
|
DailyQuestModel QuestModel
|
{
|
get { return _questModel ?? (_questModel = ModelCenter.Instance.GetModel<DailyQuestModel>()); }
|
}
|
|
public override void Refresh(CellView cell)
|
{
|
var _line = cell.index;
|
var _array = model.billRankPromotePathDict[model.presentSelectType];
|
for (int i = 0; i < 2; i++)
|
{
|
int _index = _line * 2 + i;
|
if (_index < _array.Length)
|
{
|
m_WayCells[i].gameObject.SetActive(true);
|
var _way = _array[_index];
|
GetItemWaysConfig _cfg = GetItemWaysConfig.Get(_way);
|
m_WayCells[i].icon.SetSprite(_cfg.Icon);
|
m_WayCells[i].wayName.text = _cfg.Text;
|
m_WayCells[i].funcName.text = _cfg.name;
|
m_WayCells[i].wayButton.RemoveAllListeners();
|
m_WayCells[i].wayButton.AddListener(() => {
|
ClickWayCell(_cfg);
|
});
|
}
|
else
|
{
|
m_WayCells[i].gameObject.SetActive(false);
|
}
|
}
|
}
|
|
private void ClickWayCell(GetItemWaysConfig cfg)
|
{
|
WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)cfg.OpenpanelId);
|
}
|
}
|
}
|