From e3e8dc5a2d3359f7be1431b97dee88fd1afcb62f Mon Sep 17 00:00:00 2001 From: liutao <821580467@qq.com> Date: Tue, 7 Apr 2026 19:33:49 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=97=A5=E5=BF=97=E3=80=91=E7=94=B1?= =?UTF-8?q?=E5=86=85=E7=BD=91=E6=8E=A7=E5=88=B6=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Code/Scripts/GameWrapper/Main.cs | 29 +++++++++++++++++-- ProjectNLD/Assets/PhxhSDK | 2 +- 2 files changed, 28 insertions(+), 3 deletions(-) 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