参数先使用本地值,获取到在线参数后再覆盖

This commit is contained in:
juncong lee 2025-09-01 19:18:58 +08:00
parent b7b1b2c9f4
commit dd4d2c09ae
2 changed files with 38 additions and 5 deletions

View File

@ -44,7 +44,18 @@ namespace WZ
/// </summary>
public static List<string> GetAdmobAdUnits(AdsType adType)
{
if (_config == null) return new List<string>();
if (_config == null)
{
return adType switch
{
AdsType.Banner => new List<string> { StaticValue.AdmobNormalBannerId },
AdsType.Rewarded => new List<string> { StaticValue.AdmobRewardId },
AdsType.Native => new List<string> { StaticValue.AdmobNativeId },
AdsType.Splash => new List<string> { StaticValue.AdmobSplashId },
AdsType.Interstitial => new List<string> { StaticValue.AdmobInterId },
_ => new List<string>()
};
}
return adType switch
{
@ -62,7 +73,15 @@ namespace WZ
/// </summary>
public static List<string> GetTopOnAdUnits(AdsType adType)
{
if (_config == null) return new List<string>();
if (_config == null)
{
return adType switch
{
AdsType.Interstitial => new List<string> { StaticValue.TopOnInterAdUnitID },
AdsType.Rewarded => new List<string> { StaticValue.TopOnRewardAdUnitID },
_ => new List<string>()
};
}
return adType switch
{
@ -80,8 +99,17 @@ namespace WZ
/// </summary>
public static List<string> GetMaxAdUnits(AdsType adType)
{
if (_config == null) return new List<string>();
if (_config == null)
{
return adType switch
{
AdsType.Interstitial => new List<string> { StaticValue.InterAdUnitID },
AdsType.Rewarded => new List<string> { StaticValue.RewardAdUnitID },
_ => new List<string>()
};
}
return adType switch
{
AdsType.Interstitial => _config.max_interstitial_units ?? new List<string>(),
@ -91,6 +119,7 @@ namespace WZ
AdsType.Native => _config.max_native_units ?? new List<string>(),
_ => new List<string>()
};
}
/// <summary>
@ -128,6 +157,7 @@ namespace WZ
/// </summary>
public static string GetTopOnAppId()
{
if (_config == null) return StaticValue.TopOnAppID;
return _config?.topon_app_id;
}
@ -136,6 +166,7 @@ namespace WZ
/// </summary>
public static string GetTopOnAppKey()
{
if (_config == null) return StaticValue.TopOnAppKey;
return _config?.topon_app_key;
}
@ -144,6 +175,7 @@ namespace WZ
/// </summary>
public static string GetMaxAppKey()
{
if (_config == null) return StaticValue.ApplovinKey;
return _config?.max_app_key;
}

View File

@ -17,7 +17,8 @@ public class AppSDKManager : MonoBehaviour
private void Awake()
{
Instance = this;
// 解析配置文件
FileParse.Parse();
FireBaseSDKManager.Instance.Init();
AdjustManager.Instance.Init();
ShuShuMangage.Instance.Init();