[change] il2cpp_plus启动新的分支名 2019-main、2020-main、2021-main,相应调整代码

[opt] 优化installer的显示
main
walon 2022-11-29 09:23:24 +08:00
parent f36da3529a
commit 5270f307b9
3 changed files with 12 additions and 37 deletions

View File

@ -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,
}

View File

@ -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();

View File

@ -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",