Update EventInterfaceGenerate.cs

This commit is contained in:
ALEXTANG
2023-12-14 15:07:04 +08:00
parent b661da68f2
commit ba77ec6b45

View File

@@ -15,6 +15,7 @@ Example:
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
@@ -136,10 +137,17 @@ public static class EventInterfaceGenerate
// 获取接口中的所有方法
MethodInfo[] methods = interfaceType.GetMethods();
HashSet<string> hadGenerate = new HashSet<string>();
//组件字段
foreach (MethodInfo method in methods)
{
if (hadGenerate.Contains(method.Name))
{
continue;
}
sw.WriteLine($"\t\tpublic static readonly int {method.Name} = RuntimeId.ToRuntimeId(\"{interfaceName}_Event.{method.Name}\");");
hadGenerate.Add(method.Name);
}
sw.WriteLine("\t}");