diff --git a/Editor/Installer/InstallerController.cs b/Editor/Installer/InstallerController.cs index 25f628c..4f3d956 100644 --- a/Editor/Installer/InstallerController.cs +++ b/Editor/Installer/InstallerController.cs @@ -122,13 +122,14 @@ namespace HybridCLR.Editor.Installer { switch(majorVersion) { + case 2020: return $"2020.3.{min2020_3_CompatibleMinorVersion}"; case 2021: return $"2021.3.{min2021_3_CompatibleMinorVersion}"; case 2022: return $"2022.3.{min2022_3_CompatibleMinorVersion}"; - default: throw new Exception($"not support version:{majorVersion}"); + default: return $"2020.3.{min2020_3_CompatibleMinorVersion}"; } } - public bool IsComaptibleVersion() + public bool IsCompatibleVersion() { UnityVersion version = _curVersion; if (version == null) @@ -157,9 +158,9 @@ namespace HybridCLR.Editor.Installer } } - public string HybridclrLocalVersion => _curDefaultVersion.hybridclr.branch; + public string HybridclrLocalVersion => _curDefaultVersion?.hybridclr?.branch; - public string Il2cppPlusLocalVersion => _curDefaultVersion.il2cpp_plus.branch; + public string Il2cppPlusLocalVersion => _curDefaultVersion?.il2cpp_plus?.branch; private string GetIl2CppPathByContentPath(string contentPath) @@ -222,7 +223,7 @@ namespace HybridCLR.Editor.Installer private void RunInitLocalIl2CppData(string editorIl2cppPath, string libil2cppWithHybridclrSourceDir, UnityVersion version) { - if (!IsComaptibleVersion()) + if (!IsCompatibleVersion()) { Debug.LogError($"il2cpp 版本不兼容,最小版本为 {GetCurrentUnityVersionMinCompatibleVersionStr()}"); return; diff --git a/Editor/Installer/InstallerWindow.cs b/Editor/Installer/InstallerWindow.cs index 61535a8..7e1a71f 100644 --- a/Editor/Installer/InstallerWindow.cs +++ b/Editor/Installer/InstallerWindow.cs @@ -54,13 +54,13 @@ namespace HybridCLR.Editor.Installer GUILayout.Space(10f); - if (_controller.IsComaptibleVersion()) + if (_controller.IsCompatibleVersion()) { GUIInstallButton("安装hybridclr+il2cpp_plus代码到本地目录", "安装"); } else { - EditorGUILayout.HelpBox("与当前版本不兼容", MessageType.Error); + EditorGUILayout.HelpBox($"与当前版本不兼容,最小兼容版本:{_controller.GetCurrentUnityVersionMinCompatibleVersionStr()}", MessageType.Error); } EditorGUILayout.EndVertical();