Fix AOT metadata loading for smoke builds
This commit is contained in:
parent
ac09170856
commit
75bbc0131e
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using HybridCLR;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TH1_Logic.Hotfix
|
||||
@ -85,26 +86,6 @@ namespace TH1_Logic.Hotfix
|
||||
{
|
||||
if (_aotMetadataLoaded) return;
|
||||
|
||||
var runtimeApiType = FindType("HybridCLR.RuntimeApi");
|
||||
var modeType = FindType("HybridCLR.HomologousImageMode");
|
||||
if (runtimeApiType == null || modeType == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var method = runtimeApiType.GetMethod(
|
||||
"LoadMetadataForAOTAssembly",
|
||||
BindingFlags.Public | BindingFlags.Static,
|
||||
null,
|
||||
new[] { typeof(byte[]), modeType },
|
||||
null);
|
||||
if (method == null)
|
||||
{
|
||||
Debug.LogWarning("[TH1.Hotfix] HybridCLR RuntimeApi.LoadMetadataForAOTAssembly not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
var mode = Enum.Parse(modeType, "SuperSet");
|
||||
var aotDir = Path.Combine(root, HotfixManifest.AotMetadataFolderName);
|
||||
var allLoaded = true;
|
||||
|
||||
@ -118,7 +99,7 @@ namespace TH1_Logic.Hotfix
|
||||
continue;
|
||||
}
|
||||
|
||||
var result = method.Invoke(null, new object[] { File.ReadAllBytes(path), mode });
|
||||
var result = RuntimeApi.LoadMetadataForAOTAssembly(File.ReadAllBytes(path), HomologousImageMode.SuperSet);
|
||||
Debug.Log($"[TH1.Hotfix] Load AOT metadata {fileName}: {result}");
|
||||
}
|
||||
|
||||
|
||||
@ -77,7 +77,7 @@ namespace TH1_Logic.Editor
|
||||
|
||||
PlayerSettings.SetScriptingBackend(group, ScriptingImplementation.IL2CPP);
|
||||
EditorUserBuildSettings.development = true;
|
||||
EditorUserBuildSettings.allowDebugging = true;
|
||||
EditorUserBuildSettings.allowDebugging = false;
|
||||
PlayerSettings.usePlayerLog = true;
|
||||
PlayerSettings.SetStackTraceLogType(LogType.Log, StackTraceLogType.ScriptOnly);
|
||||
PlayerSettings.SetStackTraceLogType(LogType.Warning, StackTraceLogType.ScriptOnly);
|
||||
@ -110,7 +110,7 @@ namespace TH1_Logic.Editor
|
||||
locationPathName = outputExe,
|
||||
target = BuildTarget.StandaloneWindows64,
|
||||
targetGroup = BuildTargetGroup.Standalone,
|
||||
options = BuildOptions.Development | BuildOptions.AllowDebugging
|
||||
options = BuildOptions.Development
|
||||
};
|
||||
|
||||
var report = BuildPipeline.BuildPlayer(options);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user