ScriptingImplementation.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. namespace XGame.Editor.Build
  2. {
  3. /// <summary>
  4. /// 摘要: Scripting implementation (backend).
  5. /// </summary>
  6. public enum ScriptingImplementation
  7. {
  8. /// <summary>
  9. /// Unity's .NET runtime.
  10. /// 这里将IL2CPP设置为零,打包时默认为IL2CPP
  11. /// </summary>
  12. IL2CPP = 0,
  13. //
  14. // 摘要:
  15. // The standard Mono 2.6 runtime.
  16. Mono2x = 1,
  17. //
  18. // 摘要:
  19. // Microsoft's .NET runtime.
  20. //WinRTDotNET = 3
  21. }
  22. public static class ScriptingImplementationExt
  23. {
  24. public static UnityEditor.ScriptingImplementation ToUnityImpl(this ScriptingImplementation implementation)
  25. {
  26. switch (implementation)
  27. {
  28. case ScriptingImplementation.Mono2x:
  29. return UnityEditor.ScriptingImplementation.Mono2x;
  30. case ScriptingImplementation.IL2CPP:
  31. return UnityEditor.ScriptingImplementation.IL2CPP;
  32. default:
  33. throw new System.NotImplementedException();
  34. }
  35. }
  36. }
  37. }