[fix] 修复微信小游戏平台当TextureCompression非默认值时临时目录名为WinxinMiniGame{xxx},导致没有成功修改scriptingassemblies.json文件的bug

main
walon 2024-07-12 17:54:59 +08:00
parent 0b455eb882
commit 5747458bf2
1 changed files with 18 additions and 9 deletions

View File

@ -35,18 +35,27 @@ namespace HybridCLR.MonoHook
private static string BuildMainWindowTitle() private static string BuildMainWindowTitle()
{ {
foreach (var tempJsonPath in Directory.GetDirectories($"{Application.dataPath}/../Library/PlayerDataCache", "*", SearchOption.TopDirectoryOnly))
{
string dirName = Path.GetFileName(tempJsonPath);
#if UNITY_WEIXINMINIGAME #if UNITY_WEIXINMINIGAME
Debug.Assert(EditorUserBuildSettings.activeBuildTarget == BuildTarget.WeixinMiniGame); Debug.Assert(EditorUserBuildSettings.activeBuildTarget == BuildTarget.WeixinMiniGame);
string tempJsonPath = $"{Application.dataPath}/../Library/PlayerDataCache/WeixinMiniGame/Data/ScriptingAssemblies.json"; if (!dirName.Contains("WeixinMiniGame"))
{
continue;
}
#else #else
Debug.Assert(EditorUserBuildSettings.activeBuildTarget == BuildTarget.WebGL); Debug.Assert(EditorUserBuildSettings.activeBuildTarget == BuildTarget.WebGL);
string tempJsonPath = $"{Application.dataPath}/../Library/PlayerDataCache/WebGL/Data/ScriptingAssemblies.json"; if (!dirName.Contains("WebGL"))
#endif
if (File.Exists(tempJsonPath))
{ {
var patcher = new PatchScriptingAssemblyList(); continue;
patcher.PathScriptingAssembilesFile(Path.GetDirectoryName(tempJsonPath));
} }
#endif
var patcher = new PatchScriptingAssemblyList();
patcher.PathScriptingAssembilesFile(tempJsonPath);
}
string newTitle = BuildMainWindowTitleProxy(); string newTitle = BuildMainWindowTitleProxy();
return newTitle; return newTitle;
} }