Skip to content

Commit

Permalink
[unity] reuse variable
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieyang committed Nov 2, 2023
1 parent 55ae6e8 commit 3c5b747
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions unity/Assets/core/upm/Editor/Src/Generator/IL2Cpp/UnityMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 3c5b747

Please sign in to comment.