[new] 支持Unity 6

main
walon 2024-05-20 11:44:38 +08:00
parent ef1b78caae
commit b96d6fc10d
7 changed files with 27 additions and 10 deletions

View File

@ -24,6 +24,11 @@
"unity_version":"2022-tuanjie", "unity_version":"2022-tuanjie",
"hybridclr" : { "branch":"v5.4.0"}, "hybridclr" : { "branch":"v5.4.0"},
"il2cpp_plus": { "branch":"v2022-tuanjie-5.4.0"} "il2cpp_plus": { "branch":"v2022-tuanjie-5.4.0"}
},
{
"unity_version":"6000",
"hybridclr" : { "branch":"v5.4.0"},
"il2cpp_plus": { "branch":"v6000-5.4.0"}
} }
] ]
} }

View File

@ -12,7 +12,7 @@ using System.IO;
namespace HybridCLR.MonoHook namespace HybridCLR.MonoHook
{ {
#if UNITY_2021_1_OR_NEWER #if UNITY_2021_1_OR_NEWER && !UNITY_6000_0_OR_NEWER
[InitializeOnLoad] [InitializeOnLoad]
public class CopyStrippedAOTAssembliesHook public class CopyStrippedAOTAssembliesHook
{ {

View File

@ -12,7 +12,7 @@ using System.IO;
namespace HybridCLR.MonoHook namespace HybridCLR.MonoHook
{ {
#if UNITY_2022 #if UNITY_2022 || UNITY_6000_0_OR_NEWER
[InitializeOnLoad] [InitializeOnLoad]
public class GetIl2CppFolderHook public class GetIl2CppFolderHook
{ {

View File

@ -8,9 +8,11 @@ using System.Threading.Tasks;
using UnityEditor; using UnityEditor;
using UnityEditor.Build; using UnityEditor.Build;
using UnityEditor.Build.Reporting; using UnityEditor.Build.Reporting;
using UnityEditor.Il2Cpp;
using UnityEditor.UnityLinker; using UnityEditor.UnityLinker;
using UnityEngine; using UnityEngine;
#if !UNITY_2021_1_OR_NEWER
using UnityEditor.Il2Cpp;
#endif
namespace HybridCLR.Editor.BuildProcessors namespace HybridCLR.Editor.BuildProcessors
{ {

View File

@ -9,10 +9,12 @@ using UnityEditor;
using UnityEditor.Android; using UnityEditor.Android;
using UnityEditor.Build; using UnityEditor.Build;
using UnityEditor.Build.Reporting; using UnityEditor.Build.Reporting;
using UnityEditor.Il2Cpp;
using UnityEditor.UnityLinker; using UnityEditor.UnityLinker;
using UnityEngine; using UnityEngine;
using UnityFS; using UnityFS;
#if !UNITY_2021_1_OR_NEWER
using UnityEditor.Il2Cpp;
#endif
namespace HybridCLR.Editor.BuildProcessors namespace HybridCLR.Editor.BuildProcessors
{ {

View File

@ -52,7 +52,14 @@ namespace HybridCLR.Editor.Il2CppDef
lines.Add($"#define HYBRIDCLR_UNITY_VERSION {majorVer}{minorVer1.ToString("D2")}{minorVer2.ToString("D2")}"); lines.Add($"#define HYBRIDCLR_UNITY_VERSION {majorVer}{minorVer1.ToString("D2")}{minorVer2.ToString("D2")}");
lines.Add($"#define HYBRIDCLR_UNITY_{majorVer} 1"); lines.Add($"#define HYBRIDCLR_UNITY_{majorVer} 1");
for (int ver = 2019; ver <= 2024; ver++) for (int ver = 2019; ver <= 2023; ver++)
{
if (majorVer >= ver)
{
lines.Add($"#define HYBRIDCLR_UNITY_{ver}_OR_NEW 1");
}
}
for (int ver = 6000; ver <= 6100; ver++)
{ {
if (majorVer >= ver) if (majorVer >= ver)
{ {

View File

@ -122,10 +122,11 @@ namespace HybridCLR.Editor.Installer
{ {
switch(majorVersion) switch(majorVersion)
{ {
case 2019: return $"2019.4.0"; case 2019: return "2019.4.0";
case 2020: return $"2020.3.0"; case 2020: return "2020.3.0";
case 2021: return $"2021.3.0"; case 2021: return "2021.3.0";
case 2022: return $"2022.3.0"; case 2022: return "2022.3.0";
case 6000: return "6000.0.0";
default: return $"2020.3.0"; default: return $"2020.3.0";
} }
} }
@ -144,7 +145,7 @@ namespace HybridCLR.Editor.Installer
{ {
return CompatibleType.Incompatible; return CompatibleType.Incompatible;
} }
if ((version.major == 2019 && version.minor1 < 4) || (version.major >= 2020 && version.minor1 < 3)) if ((version.major == 2019 && version.minor1 < 4) || (version.major >= 2020 && version.major < 6000 && version.minor1 < 3))
{ {
return CompatibleType.MaybeIncompatible; return CompatibleType.MaybeIncompatible;
} }