From 3c5b7476edbb97380118fcf37d8b524a1c193f87 Mon Sep 17 00:00:00 2001 From: zombieyang Date: Thu, 2 Nov 2023 12:04:33 +0800 Subject: [PATCH] [unity] reuse variable --- .../upm/Editor/Src/Generator/IL2Cpp/UnityMenu.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/unity/Assets/core/upm/Editor/Src/Generator/IL2Cpp/UnityMenu.cs b/unity/Assets/core/upm/Editor/Src/Generator/IL2Cpp/UnityMenu.cs index 30db6e79dc..1912ac161e 100644 --- a/unity/Assets/core/upm/Editor/Src/Generator/IL2Cpp/UnityMenu.cs +++ b/unity/Assets/core/upm/Editor/Src/Generator/IL2Cpp/UnityMenu.cs @@ -20,9 +20,7 @@ namespace PuertsIl2cpp.Editor namespace Generator { public class UnityMenu { - public const string PUERTS_MENU_PREFIX = "Tools/PuerTS"; - - [MenuItem(PUERTS_MENU_PREFIX + "/Generate For xIl2cpp mode (all in one)", false, 2)] + [MenuItem(Puerts.Editor.Generator.UnityMenu.PUERTS_MENU_PREFIX + "/Generate For xIl2cpp mode (all in one)", false, 2)] public static void GenV2() { PuertsIl2cpp.Editor.Generator.UnityMenu.GenerateCppWrappers(); PuertsIl2cpp.Editor.Generator.UnityMenu.GenerateExtensionMethodInfos(); @@ -34,7 +32,7 @@ public static void GenV2() { #endif } - [MenuItem(PUERTS_MENU_PREFIX + "/Generate/xIl2cpp c file", false, 6)] + [MenuItem(Puerts.Editor.Generator.UnityMenu.PUERTS_MENU_PREFIX + "/Generate/xIl2cpp c file", false, 6)] public static void GenerateCppPlugin() { #if CPP_OUTPUT_TO_NATIVE_SRC @@ -49,7 +47,7 @@ public static void GenerateCppPlugin() FileExporter.GenMarcoHeader(saveTo); } - [MenuItem(PUERTS_MENU_PREFIX + "/Generate/xIl2cpp FunctionBridge.Gen.h", false, 6)] + [MenuItem(Puerts.Editor.Generator.UnityMenu.PUERTS_MENU_PREFIX + "/Generate/xIl2cpp FunctionBridge.Gen.h", false, 6)] public static void GenerateCppWrappers() { var start = DateTime.Now; @@ -66,7 +64,7 @@ public static void GenerateCppWrappers() Debug.Log("finished! use " + (DateTime.Now - start).TotalMilliseconds + " ms Outputed to " + saveTo); } - [MenuItem(PUERTS_MENU_PREFIX + "/Generate/xIl2cpp FunctionBridge.Gen.h(Configure)", false, 6)] + [MenuItem(Puerts.Editor.Generator.UnityMenu.PUERTS_MENU_PREFIX + "/Generate/xIl2cpp FunctionBridge.Gen.h(Configure)", false, 6)] public static void GenerateCppWrappersInConfigure() { var start = DateTime.Now; @@ -83,7 +81,7 @@ public static void GenerateCppWrappersInConfigure() Debug.Log("finished! use " + (DateTime.Now - start).TotalMilliseconds + " ms Outputed to " + saveTo); } - [MenuItem(PUERTS_MENU_PREFIX + "/Generate/xIl2cpp ExtensionMethodInfos_Gen.cs", false, 6)] + [MenuItem(Puerts.Editor.Generator.UnityMenu.PUERTS_MENU_PREFIX + "/Generate/xIl2cpp ExtensionMethodInfos_Gen.cs", false, 6)] public static void GenerateExtensionMethodInfos() { var start = DateTime.Now; @@ -95,7 +93,7 @@ public static void GenerateExtensionMethodInfos() AssetDatabase.Refresh(); } - [MenuItem(PUERTS_MENU_PREFIX + "/Generate/Link.xml", false, 6)] + [MenuItem(Puerts.Editor.Generator.UnityMenu.PUERTS_MENU_PREFIX + "/Generate/Link.xml", false, 6)] public static void GenerateLinkXML() { var start = DateTime.Now;