23 lines
677 B
C#
Executable File
23 lines
677 B
C#
Executable File
namespace ET
|
|
{
|
|
public static class GlobalMethodHelper
|
|
{
|
|
public static async ETTask<string> Call(string methodName, object args)
|
|
{
|
|
var dic = Game.Scene.GetComponent<GlobalMethodComponent>().methodDic;
|
|
if (!dic.TryGetValue(methodName, out var action))
|
|
{
|
|
Log.Error($"don't has the mrthod : {methodName}");
|
|
return "系统错误001";
|
|
}
|
|
|
|
if (action == null)
|
|
{
|
|
Log.Error($"action == null where name = {methodName}");
|
|
return "系统错误002";
|
|
}
|
|
|
|
return await action.Invoke(args);
|
|
}
|
|
}
|
|
} |