Il2CppDefGeneratorCommand.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. using HybridCLR.Editor.Link;
  2. using HybridCLR.Editor.Settings;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Reflection;
  7. using UnityEditor;
  8. using UnityEngine;
  9. namespace HybridCLR.Editor.Commands
  10. {
  11. public static class Il2CppDefGeneratorCommand
  12. {
  13. [MenuItem("HybridCLR/Generate/Il2CppDef", priority = 104)]
  14. public static void GenerateIl2CppDef()
  15. {
  16. var options = new Il2CppDef.Il2CppDefGenerator.Options()
  17. {
  18. UnityVersion = Application.unityVersion,
  19. HotUpdateAssemblies = SettingsUtil.HotUpdateAssemblyNamesIncludePreserved,
  20. UnityVersionTemplateFile = $"{SettingsUtil.TemplatePathInPackage}/UnityVersion.h.tpl",
  21. UnityVersionOutputFile = $"{SettingsUtil.LocalIl2CppDir}/libil2cpp/hybridclr/generated/UnityVersion.h",
  22. AssemblyManifestTemplateFile = $"{SettingsUtil.TemplatePathInPackage}/AssemblyManifest.cpp.tpl",
  23. AssemblyManifestOutputFile = $"{SettingsUtil.LocalIl2CppDir}/libil2cpp/hybridclr/generated/AssemblyManifest.cpp",
  24. };
  25. var g = new Il2CppDef.Il2CppDefGenerator(options);
  26. g.Generate();
  27. }
  28. }
  29. }