//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Tuesday, June 11, 2019
|
//--------------------------------------------------------
|
|
using UnityEngine.UI;
|
using System.Collections.Generic;
|
using vnxbqy.UI;
|
using UnityEngine;
|
using System;
|
|
public class TreasurePavilionActiveWin : ILWindow
|
{
|
Button m_Close;
|
List<Text> baseAttrList = new List<Text>();
|
Text starText;
|
Transform treasurePavilionCell;
|
|
float openTime;
|
#region Built-in
|
protected override void BindController()
|
{
|
m_Close = proxy.GetWidgtEx<Button>("Btn_Close");
|
for (int i = 0; i < 3; i++)
|
{
|
baseAttrList.Add(proxy.GetWidgtEx<Text>("att" + i));
|
}
|
starText = proxy.GetWidgtEx<Text>("effect");
|
treasurePavilionCell = proxy.GetWidgtEx<Transform>("TreasurePavilionCell");
|
}
|
|
protected override void AddListeners()
|
{
|
m_Close.SetListener(()=> {
|
if (Time.time - openTime < 1)
|
{
|
return;
|
}
|
CloseWin<TreasurePavilionActiveWin>();
|
});
|
}
|
|
protected override void OnPreOpen()
|
{
|
openTime = Time.time;
|
var gubaoID = TreasurePavilionModel.Instance.waitActiveGubao;
|
var config = ILGubaoConfig.Get(gubaoID);
|
var gubaoInfo = TreasurePavilionModel.Instance.TryGetGubaoInfo(gubaoID);
|
var lvConfig = ILGubaoLVConfig.Get(ILGubaoLVConfig.GetGubaoQualityLVIndex(config.GubaoType, config.GubaoQuality, gubaoInfo[1]));
|
for (int i = 0; i < baseAttrList.Count; i++)
|
{
|
if (i < lvConfig.LVAttrTypeList.Length)
|
{
|
baseAttrList[i].SetActiveIL(true);
|
baseAttrList[i].text = PlayerPropertyConfig.GetFullDescription(lvConfig.LVAttrTypeList[i], lvConfig.LVAttrValueList[i]);
|
}
|
else
|
{
|
baseAttrList[i].SetActiveIL(false);
|
}
|
}
|
|
var starEffectsInfo = TreasurePavilionModel.Instance.GetGubaoEffects(gubaoID);
|
starText.text = string.Join("\n", starEffectsInfo);
|
}
|
|
protected override void OnAfterOpen()
|
{
|
var _cell = treasurePavilionCell.GetILBehaviour<TreasurePavilionCell>();
|
_cell.Display(TreasurePavilionModel.Instance.waitActiveGubao);
|
}
|
|
protected override void OnPreClose()
|
{
|
TreasurePavilionModel.Instance.waitActiveGubao = 0;
|
}
|
|
#endregion
|
|
}
|