//--------------------------------------------------------
|
// [Author]: 玩个游戏
|
// [ Date ]: Wednesday, November 29, 2017
|
//--------------------------------------------------------
|
|
using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
public class UseItemConfirmWin : UIBase
|
{
|
[SerializeField] Button popConfirmBtn;
|
[SerializeField] Button popCancelBtn;
|
[SerializeField] RichText popConfirmInfo;
|
[SerializeField] Text popConfirmTitle;
|
[SerializeField] Text itemCount;
|
[SerializeField] Image itemIcon;
|
protected override void InitComponent()
|
{
|
base.InitComponent();
|
popConfirmBtn.onClick.AddListener(OnPopConfirmOkBtn);
|
popCancelBtn.onClick.AddListener(OnPopConfirmCancelBtn);
|
btnClickEmptyCloseEvent = OnPopConfirmCancelExBtn;
|
}
|
|
protected override void OnPreOpen()
|
{
|
base.OnPreOpen();
|
popCancelBtn.SetActive(!ConfirmCancel.IsSingleConfirm);
|
|
popConfirmTitle.text = ConfirmCancel.popConfirmTitle;
|
popConfirmInfo.text = ConfirmCancel.popConfirmInfo;
|
|
itemCount.text = UIHelper.ShowUseItem(PackType.Item, ConfirmCancel.checkItemID, ConfirmCancel.checkItemCount);
|
itemIcon.SetItemSprite(ConfirmCancel.checkItemID);
|
}
|
|
protected override void OnOpen()
|
{
|
base.OnOpen();
|
}
|
|
protected override void OnPreClose()
|
{
|
base.OnPreClose();
|
}
|
|
protected override void OnClose()
|
{
|
base.OnClose();
|
}
|
|
|
|
void OnPopConfirmOkBtn()
|
{
|
CloseWindow();
|
if (ConfirmCancel.OnPopConfirmClickEvent != null)
|
{
|
ConfirmCancel.OnPopConfirmClickEvent(true);
|
return;
|
}
|
if (ConfirmCancel.OnPopSingleConfirmEvent != null)
|
{
|
ConfirmCancel.OnPopSingleConfirmEvent();
|
}
|
}
|
|
void OnPopConfirmCancelBtn()
|
{
|
CloseWindow();
|
if (ConfirmCancel.OnPopConfirmClickEvent != null)
|
{
|
ConfirmCancel.OnPopConfirmClickEvent(false);
|
}
|
}
|
void OnPopConfirmCancelExBtn()
|
{
|
CloseWindow();
|
if (ConfirmCancel.OnPopConfirmClickExEvent != null)
|
{
|
ConfirmCancel.OnPopConfirmClickExEvent(false);
|
}
|
}
|
}
|