29 lines
700 B
C#
29 lines
700 B
C#
using ET;
|
|
using ET.EventType;
|
|
|
|
namespace ET
|
|
{
|
|
public class OnClickNPCEvent: AEvent< OnClickNPC>
|
|
{
|
|
public override async ETTask Run( OnClickNPC args)
|
|
{
|
|
try
|
|
{
|
|
var ret = await SessionComponent.Instance.Call<M2C_ClickNPC>(new C2M_ClickNPC() { NPCId = args.configId });
|
|
if (!ret.Message.IsNullOrEmpty())
|
|
{
|
|
Game.EventSystem.Publish(new ET.EventType.ShowTipUI
|
|
{
|
|
tip = ret.Message
|
|
}).Coroutine();
|
|
}
|
|
}
|
|
catch (System.Exception e)
|
|
{
|
|
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
} |