[fix] 修复微信小游戏平台当TextureCompression非默认值时临时目录名为WinxinMiniGame{xxx},导致没有成功修改scriptingassemblies.json文件的bug
parent
0b455eb882
commit
5747458bf2
|
@ -35,18 +35,27 @@ namespace HybridCLR.MonoHook
|
||||||
|
|
||||||
private static string BuildMainWindowTitle()
|
private static string BuildMainWindowTitle()
|
||||||
{
|
{
|
||||||
#if UNITY_WEIXINMINIGAME
|
foreach (var tempJsonPath in Directory.GetDirectories($"{Application.dataPath}/../Library/PlayerDataCache", "*", SearchOption.TopDirectoryOnly))
|
||||||
Debug.Assert(EditorUserBuildSettings.activeBuildTarget == BuildTarget.WeixinMiniGame);
|
|
||||||
string tempJsonPath = $"{Application.dataPath}/../Library/PlayerDataCache/WeixinMiniGame/Data/ScriptingAssemblies.json";
|
|
||||||
#else
|
|
||||||
Debug.Assert(EditorUserBuildSettings.activeBuildTarget == BuildTarget.WebGL);
|
|
||||||
string tempJsonPath = $"{Application.dataPath}/../Library/PlayerDataCache/WebGL/Data/ScriptingAssemblies.json";
|
|
||||||
#endif
|
|
||||||
if (File.Exists(tempJsonPath))
|
|
||||||
{
|
{
|
||||||
|
string dirName = Path.GetFileName(tempJsonPath);
|
||||||
|
#if UNITY_WEIXINMINIGAME
|
||||||
|
Debug.Assert(EditorUserBuildSettings.activeBuildTarget == BuildTarget.WeixinMiniGame);
|
||||||
|
if (!dirName.Contains("WeixinMiniGame"))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
Debug.Assert(EditorUserBuildSettings.activeBuildTarget == BuildTarget.WebGL);
|
||||||
|
if (!dirName.Contains("WebGL"))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
var patcher = new PatchScriptingAssemblyList();
|
var patcher = new PatchScriptingAssemblyList();
|
||||||
patcher.PathScriptingAssembilesFile(Path.GetDirectoryName(tempJsonPath));
|
patcher.PathScriptingAssembilesFile(tempJsonPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
string newTitle = BuildMainWindowTitleProxy();
|
string newTitle = BuildMainWindowTitleProxy();
|
||||||
return newTitle;
|
return newTitle;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue