[opt] 优化 PatchScriptingAssembliesJsonHook.cs在WebGL和WeixinMiniGame平台的宏开关

main
walon 2024-05-30 19:22:52 +08:00
parent 0fcb51a369
commit b977a85b23
1 changed files with 4 additions and 6 deletions

View File

@ -12,7 +12,7 @@ using System.IO;
namespace HybridCLR.MonoHook namespace HybridCLR.MonoHook
{ {
#if (UNITY_2021_1_OR_NEWER && UNITY_WEBGL) || TUANJIE_2022_3_OR_NEWER #if UNITY_2021_1_OR_NEWER && (UNITY_WEBGL || UNITY_WEIXINMINIGAME)
[InitializeOnLoad] [InitializeOnLoad]
public class PatchScriptingAssembliesJsonHook public class PatchScriptingAssembliesJsonHook
{ {
@ -35,12 +35,10 @@ namespace HybridCLR.MonoHook
private static string BuildMainWindowTitle() private static string BuildMainWindowTitle()
{ {
#if UNITY_WEBGL
string tempJsonPath = $"{Application.dataPath}/../Library/PlayerDataCache/WebGL/Data/ScriptingAssemblies.json"; string tempJsonPath = $"{Application.dataPath}/../Library/PlayerDataCache/WebGL/Data/ScriptingAssemblies.json";
#if TUANJIE_2022_3_OR_NEWER #elif UNITY_WEIXINMINIGAME
if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.WeixinMiniGame) string tempJsonPath = $"{Application.dataPath}/../Library/PlayerDataCache/WeixinMiniGame/Data/ScriptingAssemblies.json";
{
tempJsonPath = $"{Application.dataPath}/../Library/PlayerDataCache/WeixinMiniGame/Data/ScriptingAssemblies.json";
}
#endif #endif
if (File.Exists(tempJsonPath)) if (File.Exists(tempJsonPath))
{ {