mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
Update EventInterfaceGenerate.cs
This commit is contained in:
@@ -15,6 +15,7 @@ Example:
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
@@ -136,10 +137,17 @@ public static class EventInterfaceGenerate
|
|||||||
// 获取接口中的所有方法
|
// 获取接口中的所有方法
|
||||||
MethodInfo[] methods = interfaceType.GetMethods();
|
MethodInfo[] methods = interfaceType.GetMethods();
|
||||||
|
|
||||||
|
HashSet<string> hadGenerate = new HashSet<string>();
|
||||||
|
|
||||||
//组件字段
|
//组件字段
|
||||||
foreach (MethodInfo method in methods)
|
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}\");");
|
sw.WriteLine($"\t\tpublic static readonly int {method.Name} = RuntimeId.ToRuntimeId(\"{interfaceName}_Event.{method.Name}\");");
|
||||||
|
hadGenerate.Add(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
sw.WriteLine("\t}");
|
sw.WriteLine("\t}");
|
||||||
|
Reference in New Issue
Block a user