[fix] PS5构建Package包时,在IUnityLinkerProcessor.GenerateAdditionalLinkXmlFile处理 ScriptingAssemblies.json (#36)

main
Rorschach 2023-09-28 20:18:22 +08:00 committed by GitHub
parent cc09487671
commit 5c750e9c02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 3 deletions

View File

@ -20,8 +20,13 @@ namespace HybridCLR.Editor.BuildProcessors
#endif #endif
IPostprocessBuildWithReport IPostprocessBuildWithReport
#if !UNITY_2021_1_OR_NEWER && UNITY_WEBGL #if !UNITY_2021_1_OR_NEWER && UNITY_WEBGL
, IIl2CppProcessor , IIl2CppProcessor
#endif #endif
#if UNITY_PS5
, IUnityLinkerProcessor
#endif
{ {
public int callbackOrder => 0; public int callbackOrder => 0;
@ -45,11 +50,22 @@ namespace HybridCLR.Editor.BuildProcessors
// 如果target为Android,由于已经在OnPostGenerateGradelAndroidProject中处理过 // 如果target为Android,由于已经在OnPostGenerateGradelAndroidProject中处理过
// 这里不再重复处理 // 这里不再重复处理
#if !UNITY_ANDROID && !UNITY_WEBGL #if !UNITY_ANDROID && !UNITY_WEBGL
PathScriptingAssembilesFile(report.summary.outputPath); PathScriptingAssembilesFile(report.summary.outputPath);
#endif #endif
} }
#if UNITY_PS5
/// <summary>
/// 打包模式如果是 Package 需要在这个阶段提前处理 .json , PC Hosted 和 GP5 模式不受影响
/// </summary>
public string GenerateAdditionalLinkXmlFile(UnityEditor.Build.Reporting.BuildReport report, UnityEditor.UnityLinker.UnityLinkerBuildPipelineData data)
{
string path = $"{SettingsUtil.ProjectDir}/Library/PlayerDataCache/PS5/Data";
PathScriptingAssembilesFile(path);
return null;
}
#endif
public void PathScriptingAssembilesFile(string path) public void PathScriptingAssembilesFile(string path)
{ {
if (!SettingsUtil.Enable) if (!SettingsUtil.Enable)
@ -78,7 +94,7 @@ namespace HybridCLR.Editor.BuildProcessors
if (jsonFiles.Length == 0) if (jsonFiles.Length == 0)
{ {
//Debug.LogError($"can not find file {SettingsUtil.ScriptingAssembliesJsonFile}"); Debug.LogWarning($"can not find file {SettingsUtil.ScriptingAssembliesJsonFile}");
return; return;
} }