From 8b0e86a5f33293106e59213f39a4dd839883d52f Mon Sep 17 00:00:00 2001 From: huyfei Date: Wed, 17 Jan 2024 20:46:23 +0800 Subject: [PATCH] =?UTF-8?q?update=EF=BC=9A=20=E6=9B=B4=E6=96=B0=20GuruSDK?= =?UTF-8?q?=20=20=E7=9A=84=E6=A0=87=E8=AE=B0=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Runtime/Code/Config/GuruSDKInitConfig.cs | 10 +++++----- Runtime/Code/SDK/GuruSDK.cs | 13 ++++++++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Runtime/Code/Config/GuruSDKInitConfig.cs b/Runtime/Code/Config/GuruSDKInitConfig.cs index c6d653b..46f089b 100644 --- a/Runtime/Code/Config/GuruSDKInitConfig.cs +++ b/Runtime/Code/Config/GuruSDKInitConfig.cs @@ -24,9 +24,9 @@ namespace Guru /// public bool AutoRecordFinishedLevels = true; /// - /// 显示Debug日志 + /// Debug模式(默认关闭) /// - public bool ShowDebugLog = false; + public bool DebugMode = false; /// /// 云控参数的默认配置 /// @@ -62,13 +62,13 @@ namespace Guru AutoLoadWhenAdsReady = autoLoadAds, IAPEnabled = iapEnabled, AutoRecordFinishedLevels = autoRecordFinishedLevels, - ShowDebugLog = showDebugLog, + DebugMode = showDebugLog, GoogleKeys = googleKeys, AppleRootCerts = appleRootCerts, DefaultRemoteData = defaultRemoteData ?? new Dictionary(), }; #if UNITY_EDITOR - config.ShowDebugLog = true; + config.DebugMode = true; #endif return config; } @@ -85,7 +85,7 @@ namespace Guru sb.AppendLine($"\tUseCustomConsent: {UseCustomConsent}"); sb.AppendLine($"\tAutoLoadWhenAdsReady: {AutoLoadWhenAdsReady}"); sb.AppendLine($"\tIAPEnabled: {IAPEnabled}"); - sb.AppendLine($"\tShowDebugLog: {ShowDebugLog}"); + sb.AppendLine($"\tShowDebugLog: {DebugMode}"); sb.AppendLine($"------- Custom init Config -------"); return sb.ToString(); } diff --git a/Runtime/Code/SDK/GuruSDK.cs b/Runtime/Code/SDK/GuruSDK.cs index 610c8a2..15af33c 100644 --- a/Runtime/Code/SDK/GuruSDK.cs +++ b/Runtime/Code/SDK/GuruSDK.cs @@ -8,7 +8,7 @@ namespace Guru public partial class GuruSDK: MonoBehaviour { - public const string Version = "1.0.0"; + public const string Version = "1.0.4"; public const string Tag = "[Guru]"; public const string ServicesConfigKey = "guru_services"; @@ -48,7 +48,9 @@ namespace Guru return _guruSettings; } } - + + + private static bool _isDebugEnabled = false; /// /// Debug Mode /// @@ -59,7 +61,7 @@ namespace Guru #if UNITY_EDITOR || DEBUG return true; #endif - return false; + return _isDebugEnabled; } } @@ -115,10 +117,11 @@ namespace Guru Model.PropBLevel.OnValueChanged += OnBLevelChanged; Model.PropBPlay.OnValueChanged += OnBPlayChanged; + IsInitialSuccess = false; _initConfig = config; _onCompleteCallback = onComplete; - IsInitialSuccess = false; - + _isDebugEnabled = config.DebugMode; + //--- 之后的逻辑放在 Start 方法内 --- }