[fix] fixe the bug that preserving UnityEngine.PerformanceReportingModule when generating link.xml would cause the Android app built with Unity 2019 to crash on startup.

main
walon 2025-01-18 22:55:37 +08:00
parent 019412fa81
commit a11ebecf93
1 changed files with 5 additions and 0 deletions

View File

@ -43,6 +43,11 @@ namespace HybridCLR.Editor.Link
var assCollector = new AssemblyCache(_resolver);
foreach (string unityEngineDll in Directory.GetFiles(unityEngineDllPath, "UnityEngine.*.dll", SearchOption.AllDirectories))
{
// because of bug of unity 2019.4.x, preserving types in this dll will cause crash in android build
if (unityEngineDll.EndsWith("UnityEngine.PerformanceReportingModule.dll", StringComparison.InvariantCulture))
{
continue;
}
ModuleDefMD mod = assCollector.LoadModuleFromFileWithoutCache(unityEngineDll);
foreach (TypeDef type in mod.GetTypes())
{