31 lines
987 B
C#
31 lines
987 B
C#
using ET.EventType;
|
|
using ET;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace ET
|
|
{
|
|
public class ShowTipUIEvent : AEvent<ShowTipUI>
|
|
{
|
|
public override async ETTask Run(ShowTipUI args)
|
|
{
|
|
var tipUI = TipHelper.OpenUI(args.tip, args.isClearIpt, args.tipType);
|
|
if (args.okAction == null)
|
|
{
|
|
tipUI.m_btnSure.self.onClick.Clear();
|
|
tipUI.m_btnYes.self.onClick.Clear();
|
|
}
|
|
else
|
|
{
|
|
tipUI.m_btnSure.self.onClick.Set(() => args.okAction?.Invoke(tipUI.m_IptTxt.text));
|
|
tipUI.m_btnYes.self.onClick.Set(() => args.okAction?.Invoke(tipUI.m_IptTxt.text));
|
|
}
|
|
if (args.noAction == null)
|
|
tipUI.m_btnNo.self.onClick.Clear();
|
|
else
|
|
tipUI.m_btnNo.self.onClick.Set(() => args.noAction?.Invoke(tipUI.m_IptTxt.text));
|
|
await ETTask.CompletedTask;
|
|
}
|
|
}
|
|
}
|