[new] 新增对Unity 2020的支持

main
walon 2023-06-03 19:42:56 +08:00
parent 4b43870ff2
commit 8439e4176d
2 changed files with 16 additions and 10 deletions

View File

@ -1,13 +1,18 @@
{ {
"versions": [ "versions": [
{
"unity_version":"2020",
"hybridclr" : { "branch":"v3.0.3"},
"il2cpp_plus": { "branch":"v2020-3.0.0"}
},
{ {
"unity_version":"2021", "unity_version":"2021",
"hybridclr" : { "branch":"v3.0.2"}, "hybridclr" : { "branch":"v3.0.3"},
"il2cpp_plus": { "branch":"v2021-3.0.1"} "il2cpp_plus": { "branch":"v2021-3.0.1"}
}, },
{ {
"unity_version":"2022", "unity_version":"2022",
"hybridclr" : { "branch":"v3.0.2"}, "hybridclr" : { "branch":"v3.0.3"},
"il2cpp_plus": { "branch":"v2022-3.0.1"} "il2cpp_plus": { "branch":"v2022-3.0.1"}
} }
] ]

View File

@ -74,6 +74,7 @@ namespace HybridCLR.Editor.Installer
private static readonly Regex s_unityVersionPat = new Regex(@"(\d+)\.(\d+)\.(\d+)"); private static readonly Regex s_unityVersionPat = new Regex(@"(\d+)\.(\d+)\.(\d+)");
public const int min2020_3_CompatibleMinorVersion = 26;
public const int min2021_3_CompatibleMinorVersion = 0; public const int min2021_3_CompatibleMinorVersion = 0;
public const int min2022_3_CompatibleMinorVersion = 0; public const int min2022_3_CompatibleMinorVersion = 0;
@ -111,22 +112,22 @@ namespace HybridCLR.Editor.Installer
public bool IsComaptibleVersion() public bool IsComaptibleVersion()
{ {
UnityVersion version = _curVersion; UnityVersion version = _curVersion;
switch (version.major)
{
case 2021:
{
if (version.minor1 != 3) if (version.minor1 != 3)
{ {
return false; return false;
} }
switch (version.major)
{
case 2020:
{
return version.minor2 >= min2021_3_CompatibleMinorVersion;
}
case 2021:
{
return version.minor2 >= min2021_3_CompatibleMinorVersion; return version.minor2 >= min2021_3_CompatibleMinorVersion;
} }
case 2022: case 2022:
{ {
if (version.minor1 != 3)
{
return false;
}
return version.minor2 >= min2022_3_CompatibleMinorVersion; return version.minor2 >= min2022_3_CompatibleMinorVersion;
} }
default: throw new Exception($"not support il2cpp_plus branch:{version.major}"); default: throw new Exception($"not support il2cpp_plus branch:{version.major}");