//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Monday, January 28, 2019
|
//--------------------------------------------------------
|
|
using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
using vnxbqy.UI;
|
|
public class MergeServerTurntableResultWin : ILWindow
|
{
|
ItemCell itemCell = new ItemCell();
|
Button closeBtn;
|
UIEffect jpEffect;
|
UIEffect zjEffect;
|
|
MergeServerTurntableModel model = MergeServerTurntableModel.Instance;
|
|
|
#region Built-in
|
protected override void BindController()
|
{
|
itemCell = proxy.GetWidgtEx<ItemCell>("CommonItemCell");
|
closeBtn = proxy.GetWidgtEx<Button>("BackBtn");
|
jpEffect = proxy.GetWidgtEx<UIEffect>("jpUIEffect");
|
zjEffect = proxy.GetWidgtEx<UIEffect>("zjUIEffect");
|
|
|
}
|
|
protected override void AddListeners()
|
{
|
closeBtn.AddListener(()=> {
|
WindowCenter.Instance.CloseIL<MergeServerTurntableResultWin>();
|
});
|
|
}
|
|
protected override void OnPreOpen()
|
{
|
Display();
|
}
|
|
#endregion
|
|
void Display()
|
{
|
jpEffect.SetActiveIL(false);
|
zjEffect.SetActiveIL(false);
|
OperationBase operationBase = null;
|
if (!OperationTimeHepler.Instance.TryGetOperationTime(model.operationType, out operationBase))
|
{
|
return;
|
}
|
OperationTurntable operation = operationBase as OperationTurntable;
|
|
|
for (int i = 0; i < operation.turnItemList.Count; i++)
|
{
|
if (model.getItemNum == operation.turnItemList[i].ItemNum)
|
{
|
if (operation.turnItemList[i].ItemLibType == 2)
|
{
|
jpEffect.SetActiveIL(true);
|
jpEffect.Play();
|
}
|
else if (operation.turnItemList[i].ItemLibType == 3)
|
{
|
zjEffect.SetActiveIL(true);
|
zjEffect.Play();
|
}
|
|
var itemModel = new ItemCellModel((int)operation.turnItemList[i].ItemID, false, operation.turnItemList[i].ItemCount);
|
itemCell.Init(itemModel);
|
itemCell.button.SetListener(() => {
|
ItemTipUtility.Show((int)operation.turnItemList[i].ItemID);
|
});
|
return;
|
}
|
}
|
}
|
|
}
|