From dd4d2c09ae1e517aa42297f307da8aa371f4a33f Mon Sep 17 00:00:00 2001 From: juncong lee Date: Mon, 1 Sep 2025 19:18:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=85=88=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E5=80=BC=EF=BC=8C=E8=8E=B7=E5=8F=96=E5=88=B0?= =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E5=8F=82=E6=95=B0=E5=90=8E=E5=86=8D=E8=A6=86?= =?UTF-8?q?=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdsSDKManager/Utils/AdConfigParser.cs | 40 +++++++++++++++++-- Assets/Script/SDKManager/AppSDKManager.cs | 3 +- 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/Assets/Script/SDKManager/AdsSDKManager/Utils/AdConfigParser.cs b/Assets/Script/SDKManager/AdsSDKManager/Utils/AdConfigParser.cs index bfc9613..cac76d2 100644 --- a/Assets/Script/SDKManager/AdsSDKManager/Utils/AdConfigParser.cs +++ b/Assets/Script/SDKManager/AdsSDKManager/Utils/AdConfigParser.cs @@ -44,7 +44,18 @@ namespace WZ /// public static List GetAdmobAdUnits(AdsType adType) { - if (_config == null) return new List(); + if (_config == null) + { + return adType switch + { + AdsType.Banner => new List { StaticValue.AdmobNormalBannerId }, + AdsType.Rewarded => new List { StaticValue.AdmobRewardId }, + AdsType.Native => new List { StaticValue.AdmobNativeId }, + AdsType.Splash => new List { StaticValue.AdmobSplashId }, + AdsType.Interstitial => new List { StaticValue.AdmobInterId }, + _ => new List() + }; + } return adType switch { @@ -62,7 +73,15 @@ namespace WZ /// public static List GetTopOnAdUnits(AdsType adType) { - if (_config == null) return new List(); + if (_config == null) + { + return adType switch + { + AdsType.Interstitial => new List { StaticValue.TopOnInterAdUnitID }, + AdsType.Rewarded => new List { StaticValue.TopOnRewardAdUnitID }, + _ => new List() + }; + } return adType switch { @@ -80,8 +99,17 @@ namespace WZ /// public static List GetMaxAdUnits(AdsType adType) { - if (_config == null) return new List(); - + if (_config == null) + { + return adType switch + { + AdsType.Interstitial => new List { StaticValue.InterAdUnitID }, + AdsType.Rewarded => new List { StaticValue.RewardAdUnitID }, + _ => new List() + }; + } + + return adType switch { AdsType.Interstitial => _config.max_interstitial_units ?? new List(), @@ -91,6 +119,7 @@ namespace WZ AdsType.Native => _config.max_native_units ?? new List(), _ => new List() }; + } /// @@ -128,6 +157,7 @@ namespace WZ /// public static string GetTopOnAppId() { + if (_config == null) return StaticValue.TopOnAppID; return _config?.topon_app_id; } @@ -136,6 +166,7 @@ namespace WZ /// public static string GetTopOnAppKey() { + if (_config == null) return StaticValue.TopOnAppKey; return _config?.topon_app_key; } @@ -144,6 +175,7 @@ namespace WZ /// public static string GetMaxAppKey() { + if (_config == null) return StaticValue.ApplovinKey; return _config?.max_app_key; } diff --git a/Assets/Script/SDKManager/AppSDKManager.cs b/Assets/Script/SDKManager/AppSDKManager.cs index 56c2627..6bf0960 100644 --- a/Assets/Script/SDKManager/AppSDKManager.cs +++ b/Assets/Script/SDKManager/AppSDKManager.cs @@ -17,7 +17,8 @@ public class AppSDKManager : MonoBehaviour private void Awake() { Instance = this; - + // 解析配置文件 + FileParse.Parse(); FireBaseSDKManager.Instance.Init(); AdjustManager.Instance.Init(); ShuShuMangage.Instance.Init();