CTT/Unity/Assets/HotfixView/Event/UI/ShowTipUIEvent.cs

31 lines
987 B
C#
Raw Normal View History

2021-04-08 20:09:59 +08:00
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;
}
}
}