From 5270f307b9c4213ab2068a8f9af212b8cf038f04 Mon Sep 17 00:00:00 2001 From: walon Date: Tue, 29 Nov 2022 09:23:24 +0800 Subject: [PATCH] =?UTF-8?q?[change]=20il2cpp=5Fplus=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E5=88=86=E6=94=AF=E5=90=8D=202019-main?= =?UTF-8?q?=E3=80=812020-main=E3=80=812021-main=EF=BC=8C=E7=9B=B8=E5=BA=94?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81=20[opt]=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96installer=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Editor/Installer/InstallerController.cs | 30 ++++++++----------------- Editor/Installer/InstallerWindow.cs | 17 ++------------ package.json | 2 +- 3 files changed, 12 insertions(+), 37 deletions(-) diff --git a/Editor/Installer/InstallerController.cs b/Editor/Installer/InstallerController.cs index 1ca6586..2bcac40 100644 --- a/Editor/Installer/InstallerController.cs +++ b/Editor/Installer/InstallerController.cs @@ -49,19 +49,7 @@ namespace HybridCLR.Editor.Installer private string GetIl2CppPlusBranchByUnityVersion(string unityVersion) { - if (unityVersion.Contains("2019.")) - { - return "2019.4.40"; - } - if (unityVersion.Contains("2020.")) - { - return "2020.3.33"; - } - if (unityVersion.Contains("2021.")) - { - return "2021.3.1"; - } - return "not support"; + return unityVersion.Split('.')[0]; } public string Il2CppBranch => GetIl2CppPlusBranchByUnityVersion(Application.unityVersion); @@ -108,9 +96,9 @@ namespace HybridCLR.Editor.Installer { switch(branch) { - case "2019.4.40": return $"2019.4.{min2019_4_CompatibleMinorVersion}"; - case "2020.3.33": return $"2020.3.{min2020_3_CompatibleMinorVersion}"; - case "2021.3.1": return $"2021.3.{min2021_3_CompatibleMinorVersion}"; + case "2019": return $"2019.4.{min2019_4_CompatibleMinorVersion}"; + case "2020": return $"2020.3.{min2020_3_CompatibleMinorVersion}"; + case "2021": return $"2021.3.{min2021_3_CompatibleMinorVersion}"; default: throw new Exception($"not support version:{branch}"); } } @@ -123,7 +111,7 @@ namespace HybridCLR.Editor.Installer } switch(branch) { - case "2019.4.40": + case "2019": { if (unityVersion.Major != 2019 || unityVersion.Minor1 != 4) { @@ -131,7 +119,7 @@ namespace HybridCLR.Editor.Installer } return unityVersion.Minor2 >= min2019_4_CompatibleMinorVersion; } - case "2020.3.33": + case "2020": { if (unityVersion.Major != 2020 || unityVersion.Minor1 != 3) { @@ -139,7 +127,7 @@ namespace HybridCLR.Editor.Installer } return unityVersion.Minor2 >= min2020_3_CompatibleMinorVersion; } - case "2021.3.1": + case "2021": { if (unityVersion.Major != 2021 || unityVersion.Minor1 != 3) { @@ -248,7 +236,7 @@ namespace HybridCLR.Editor.Installer public bool IsUnity2019(string branch) { - return branch.Contains("2019."); + return branch.Contains("2019"); } @@ -327,7 +315,7 @@ namespace HybridCLR.Editor.Installer "clone", "--depth=1", "-b", - il2cppBranch, + $"{il2cppBranch}-main", il2cppPlusRepoURL, il2cppPlusRepoDir, } diff --git a/Editor/Installer/InstallerWindow.cs b/Editor/Installer/InstallerWindow.cs index 523057a..345416a 100644 --- a/Editor/Installer/InstallerWindow.cs +++ b/Editor/Installer/InstallerWindow.cs @@ -38,19 +38,6 @@ namespace HybridCLR.Editor.Installer string minCompatibleVersion = m_Controller.GetMinCompatibleVersion(il2cppBranch); GUI.enabled = true; GUILayout.Space(10f); - EditorGUILayout.LabelField("=======================说明===================="); - EditorGUILayout.LabelField( - $"你所在项目的Unity版本可以与il2cpp_plus版本:{il2cppBranch} 不一样。\n" - + $"如果你的Unity的版本号 >= {minCompatibleVersion}, 可以直接安装。\n" - + $"如果你的Unity的版本号 < {minCompatibleVersion}, \n" - + $"由于安装HybridCLR时需要从il2cpp_plus兼容版本{il2cppBranch}(而不是你项目版本)拷贝il2cpp目录,\n" - + $"你必须同时安装兼容版本 {il2cppBranch} 才能完成安装", EditorStyles.wordWrappedLabel); - EditorGUILayout.LabelField("=============================================="); - - GUILayout.Space(10f); - - EditorGUILayout.LabelField($"当前Unity版本: {Application.unityVersion},匹配的il2cpp_plus分支: {il2cppBranch}"); - GUILayout.Space(5f); EditorGUILayout.BeginVertical("box"); bool hasInstall = m_Controller.HasInstalledHybridCLR(); @@ -73,12 +60,12 @@ namespace HybridCLR.Editor.Installer EditorGUILayout.BeginHorizontal(); - EditorGUILayout.LabelField("待安装的 hybridclr 仓库版本号(或tag)(默认取最新版本):", GUILayout.MaxWidth(400)); + EditorGUILayout.LabelField("待安装的 hybridclr 仓库版本号(或branch或tag)(默认取最新版本):", GUILayout.MaxWidth(400)); _hybridclrVersion = EditorGUILayout.TextField(_hybridclrVersion); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); - EditorGUILayout.LabelField($"待安装的 il2cpp_plus 仓库版本号(或tag)(默认取{il2cppBranch}分支最新版本):", GUILayout.MaxWidth(400)); + EditorGUILayout.LabelField($"待安装的 il2cpp_plus 仓库版本号(或branch或tag)(默认取{il2cppBranch}-main分支最新版本):", GUILayout.MaxWidth(400)); _il2cppPlusVersion = EditorGUILayout.TextField(_il2cppPlusVersion); EditorGUILayout.EndHorizontal(); diff --git a/package.json b/package.json index ecd546a..0f00897 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.focus-creative-games.hybridclr_unity", - "version": "1.0.1", + "version": "1.1.0", "displayName": "HybridCLR", "description": "Unity package for HybridCLR. It includes editor and runtime scripts and assets for HybridCLR", "category": "Runtime",