[fix] 修复偶然情况下build apk包时,PatchScriptingAssemblyList 传递参数为apk路径,导致patch失败的bug

main
walon 2022-09-22 11:20:47 +08:00
parent a52ab358b3
commit 590505195e
3 changed files with 9 additions and 20 deletions

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 94c0855e86b12b64b8c1d29c51ac795d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -24,14 +24,19 @@ namespace HybridCLR.Editor.BuildProcessors
{ {
public int callbackOrder => 0; public int callbackOrder => 0;
public void OnPostGenerateGradleAndroidProject(string path) public void OnPostGenerateGradleAndroidProject(string path)
{ {
// 如果直接打包apk没有机会在PostprocessBuild中修改ScriptingAssemblies.json。 // 如果直接打包apk没有机会在PostprocessBuild中修改ScriptingAssemblies.json。
// 因此需要在这个时机处理 // 因此需要在这个时机处理
PathScriptingAssembilesFile(path); // Unity有bug偶然情况下会传入apk的路径导致替换失败
if (Directory.Exists(path))
{
PathScriptingAssembilesFile(path);
}
else
{
PathScriptingAssembilesFile($"{SettingsUtil.ProjectDir}/Library");
}
} }
public void OnPostprocessBuild(BuildReport report) public void OnPostprocessBuild(BuildReport report)

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: c7268273c19288b44a2ac493c8db07cd
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: