From 5446bd937cc8fac968ae8ee9cd7c27b9441e97a2 Mon Sep 17 00:00:00 2001 From: walon Date: Wed, 28 Feb 2024 14:20:39 +0800 Subject: [PATCH] =?UTF-8?q?[new]=20Installer=E6=94=AF=E6=8C=81=E5=9B=A2?= =?UTF-8?q?=E7=BB=93=E5=BC=95=E6=93=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Data~/hybridclr_version.json | 5 +++++ Editor/Installer/InstallerController.cs | 6 ++++-- Editor/Installer/InstallerWindow.cs | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Data~/hybridclr_version.json b/Data~/hybridclr_version.json index 431f8e9..d0f1e1b 100644 --- a/Data~/hybridclr_version.json +++ b/Data~/hybridclr_version.json @@ -19,6 +19,11 @@ "unity_version":"2022", "hybridclr" : { "branch":"v5.1.0"}, "il2cpp_plus": { "branch":"v2022-5.1.0"} + }, + { + "unity_version":"2022-tuanjie", + "hybridclr" : { "branch":"v5.1.0"}, + "il2cpp_plus": { "branch":"v2022-tuanjie-5.1.0"} } ] } \ No newline at end of file diff --git a/Editor/Installer/InstallerController.cs b/Editor/Installer/InstallerController.cs index 9ff7315..2f7895e 100644 --- a/Editor/Installer/InstallerController.cs +++ b/Editor/Installer/InstallerController.cs @@ -33,7 +33,7 @@ namespace HybridCLR.Editor.Installer { _curVersion = ParseUnityVersion(Application.unityVersion); _versionManifest = GetHybridCLRVersionManifest(); - _curDefaultVersion = _versionManifest.versions.FirstOrDefault(v => v.unity_version == _curVersion.major.ToString()); + _curDefaultVersion = _versionManifest.versions.FirstOrDefault(v => _curVersion.isTuanjieEngine ? v.unity_version == $"{_curVersion.major}-tuanjie" : v.unity_version == _curVersion.major.ToString()); PackageVersion = LoadPackageInfo().version; InstalledLibil2cppVersion = ReadLocalVersion(); } @@ -88,6 +88,7 @@ namespace HybridCLR.Editor.Installer public int major; public int minor1; public int minor2; + public bool isTuanjieEngine; public override string ToString() { @@ -108,7 +109,8 @@ namespace HybridCLR.Editor.Installer int major = int.Parse(match.Groups[1].Value); int minor1 = int.Parse(match.Groups[2].Value); int minor2 = int.Parse(match.Groups[3].Value); - return new UnityVersion { major = major, minor1 = minor1, minor2 = minor2 }; + bool isTuanjieEngine = versionStr.Contains("t"); + return new UnityVersion { major = major, minor1 = minor1, minor2 = minor2, isTuanjieEngine = isTuanjieEngine }; } public string GetCurrentUnityVersionMinCompatibleVersionStr() diff --git a/Editor/Installer/InstallerWindow.cs b/Editor/Installer/InstallerWindow.cs index 676fe6e..1869f89 100644 --- a/Editor/Installer/InstallerWindow.cs +++ b/Editor/Installer/InstallerWindow.cs @@ -44,9 +44,9 @@ namespace HybridCLR.Editor.Installer EditorGUILayout.LabelField($"Installed: {hasInstall}", EditorStyles.boldLabel); GUILayout.Space(10f); - EditorGUILayout.LabelField($"Package Version: v{_controller.PackageVersion}"); + EditorGUILayout.LabelField($"Package Version: v{_controller.PackageVersion}"); GUILayout.Space(5f); - EditorGUILayout.LabelField($"Installed Version: {_controller.InstalledLibil2cppVersion ?? "Unknown"}"); + EditorGUILayout.LabelField($"Installed Version: v{_controller.InstalledLibil2cppVersion ?? " Unknown"}"); GUILayout.Space(5f); GUILayout.Space(10f);