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();