30 lines
774 B
C#
30 lines
774 B
C#
using ET;
|
|
using ET.EventType;
|
|
|
|
namespace ET
|
|
{
|
|
public class OnClickNPCEvent: AEvent< OnClickNPC>
|
|
{
|
|
public override async ETTask Run( OnClickNPC args)
|
|
{
|
|
try
|
|
{
|
|
var zoneScene = args.zoneScene;
|
|
M2C_ClickNPC ret = await zoneScene.GetComponent<SessionComponent>().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;
|
|
}
|
|
|
|
}
|
|
}
|
|
} |