diff --git a/ProjectNLD/Assets/Code/Scripts/GameWrapper/Main.cs b/ProjectNLD/Assets/Code/Scripts/GameWrapper/Main.cs index 1fff54e6caf..f2aafa718e3 100644 --- a/ProjectNLD/Assets/Code/Scripts/GameWrapper/Main.cs +++ b/ProjectNLD/Assets/Code/Scripts/GameWrapper/Main.cs @@ -4,6 +4,8 @@ using PhxhSDK.AOT.Aspect; using PhxhSDK.Reference; using System; using System.Reflection; +using Cysharp.Threading.Tasks; +using PhxhSDK.AOT.Net; using UnityEngine; namespace Gameplay @@ -66,22 +68,45 @@ namespace Gameplay { } - private void Start() + private async UniTask _DynamicEnableLog() { + if (InformationShower.Instance != null) + { + // 先默认关闭 + InformationShower.Instance.enabled = false; + } + // 默认关闭 var shouldEnableDebug = false; -#if DEBUG || DEVELOPMENT_BUILD +#if DEBUG || DEVELOPMENT_BUILD || UNITY_EDITOR shouldEnableDebug = true; #endif + + if (!shouldEnableDebug) + { + // 不开启的时候, 如果在内网环境则强行开启 + if (await NetChecker.CheckIsInsideNet()) + { + shouldEnableDebug = true; + } + } + Debug.Log("[Debug] Debug log enabled: " + shouldEnableDebug); Debug.unityLogger.logEnabled = shouldEnableDebug; DebugUtil.LogEnable = shouldEnableDebug; + // 同步控制FPS显示 if (InformationShower.Instance != null) { InformationShower.Instance.enabled = shouldEnableDebug; } + } + + private void Start() + { + _DynamicEnableLog(); + _lastSecondUpdate = Time.time; _lastTenthSecondUpdate = Time.time; diff --git a/ProjectNLD/Assets/PhxhSDK b/ProjectNLD/Assets/PhxhSDK index 02904eb6e07..e7fbb88c88b 160000 --- a/ProjectNLD/Assets/PhxhSDK +++ b/ProjectNLD/Assets/PhxhSDK @@ -1 +1 @@ -Subproject commit 02904eb6e075af9d684964c609d8be644b6a01cd +Subproject commit e7fbb88c88ba7587de0103d4daec0812fe6e28bf