2021-04-08 20:09:59 +08:00
|
|
|
|
using ET;
|
|
|
|
|
using ET.EventType;
|
|
|
|
|
|
|
|
|
|
namespace ET
|
|
|
|
|
{
|
|
|
|
|
public class OnClickNPCEvent: AEvent< OnClickNPC>
|
|
|
|
|
{
|
|
|
|
|
public override async ETTask Run( OnClickNPC args)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
2021-04-11 19:50:39 +08:00
|
|
|
|
M2C_ClickNPC ret = await SessionComponent.Instance.Call<M2C_ClickNPC>(new C2M_ClickNPC() { NPCId = args.configId });
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (!ret.Message.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
Game.EventSystem.Publish(new ET.EventType.ShowTipUI
|
|
|
|
|
{
|
|
|
|
|
tip = ret.Message
|
|
|
|
|
}).Coroutine();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (System.Exception e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
throw e;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|