//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Thursday, June 06, 2019
|
//--------------------------------------------------------
|
|
using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
namespace Snxxz.UI
|
{
|
|
public class AuctionBetterConfirmWin : Window
|
{
|
[SerializeField] Text m_Remind;
|
[SerializeField] Button m_CloseBtn;
|
[SerializeField] Button m_UseBtn;
|
[SerializeField] Button m_Auction;
|
|
public static int remindType = 0;
|
|
AuctionHelpModel auctionHelpModel { get { return ModelCenter.Instance.GetModel<AuctionHelpModel>(); } }
|
|
#region Built-in
|
protected override void BindController()
|
{
|
}
|
|
protected override void AddListeners()
|
{
|
m_CloseBtn.AddListener(CloseClick);
|
m_UseBtn.AddListener(OnSelfUse);
|
m_Auction.AddListener(OnAuction);
|
}
|
|
protected override void OnPreOpen()
|
{
|
Display();
|
}
|
|
protected override void OnAfterOpen()
|
{
|
}
|
|
protected override void OnPreClose()
|
{
|
}
|
|
protected override void OnAfterClose()
|
{
|
}
|
#endregion
|
|
private void Display()
|
{
|
m_Remind.text = Language.Get("ItemAuctionConfirm_" + remindType);
|
}
|
|
private void OnAuction()
|
{
|
CloseImmediately();
|
|
AuctionInquiry.Instance.SendSellAuctionItem(auctionHelpModel.ItemModel.itemInfo.index);
|
}
|
|
private void OnSelfUse()
|
{
|
CloseImmediately();
|
|
if (ItemLogicUtility.Instance.IsOverdue(auctionHelpModel.ItemModel.guid))
|
{
|
ItemOperateUtility.Instance.ProcessOverdueItem(auctionHelpModel.ItemModel.guid);
|
}
|
else
|
{
|
ItemOperateUtility.Instance.UseItem(auctionHelpModel.ItemModel.guid);
|
}
|
}
|
|
}
|
|
}
|
|
|
|
|