Il2CppDefGeneratorCommand.cs 735 B

12345678910111213141516171819202122232425262728
  1. using HybridCLR.Editor.Link;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Reflection;
  6. using UnityEditor;
  7. using UnityEngine;
  8. namespace HybridCLR.Editor.Commands
  9. {
  10. public static class Il2CppDefGeneratorCommand
  11. {
  12. [MenuItem("HybridCLR/Generate/Il2CppDef", priority = 104)]
  13. public static void GenerateIl2CppDef()
  14. {
  15. var options = new Il2CppDef.Il2CppDefGenerator.Options()
  16. {
  17. UnityVersion = Application.unityVersion,
  18. OutputFile = $"{SettingsUtil.LocalIl2CppDir}/libil2cpp/il2cpp-config.h",
  19. };
  20. var g = new Il2CppDef.Il2CppDefGenerator(options);
  21. g.Generate();
  22. }
  23. }
  24. }