[fix] 修复团结引擎微信小游戏平台由于同时定义了UNITY_WEIXINMINIGAME和UNITY_WEBGL宏,导致从错误路径查找scriptingassemblies.json文件失败,运行时出现脚本missing的bug

main
walon 2024-07-02 17:00:05 +08:00
parent 909e96ca7c
commit e086228d90
1 changed files with 5 additions and 3 deletions

View File

@ -35,10 +35,12 @@ namespace HybridCLR.MonoHook
private static string BuildMainWindowTitle()
{
#if UNITY_WEBGL
string tempJsonPath = $"{Application.dataPath}/../Library/PlayerDataCache/WebGL/Data/ScriptingAssemblies.json";
#elif UNITY_WEIXINMINIGAME
#if UNITY_WEIXINMINIGAME
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))
{