udpate: 初始化参数添加 去广告 和 banner 背景色
							parent
							
								
									fec486e8a6
								
							
						
					
					
						commit
						311b53ea5f
					
				|  | @ -28,6 +28,14 @@ namespace Guru | |||
|         /// </summary> | ||||
|         public string CustomServiceKey = ""; | ||||
|         /// <summary> | ||||
|         /// Banner 背景颜色 Hex 值 | ||||
|         /// </summary> | ||||
|         public string BannerBackgroundColor = "#00000000"; | ||||
|         /// <summary> | ||||
|         /// 已购买去广告道具 | ||||
|         /// </summary> | ||||
|         public bool IsBuyNoAds = false; | ||||
|         /// <summary> | ||||
|         /// Debug模式(默认关闭) | ||||
|         /// </summary> | ||||
|         public bool DebugMode = false; | ||||
|  | @ -54,6 +62,8 @@ namespace Guru | |||
|             bool autoLoadAds = true,  | ||||
|             bool iapEnabled = true,  | ||||
|             bool autoRecordFinishedLevels = true,  | ||||
|             bool isBuyNoAds = false, | ||||
|             string bannerBackgroundColor = "#00000000", | ||||
|             bool debugMode = false, | ||||
|             Dictionary<string, object> defaultRemoteData = null, | ||||
|             byte[] googleKeys = null, | ||||
|  | @ -66,6 +76,8 @@ namespace Guru | |||
|                 AutoLoadWhenAdsReady = autoLoadAds, | ||||
|                 IAPEnabled = iapEnabled, | ||||
|                 AutoRecordFinishedLevels = autoRecordFinishedLevels, | ||||
|                 IsBuyNoAds = isBuyNoAds, | ||||
|                 BannerBackgroundColor = bannerBackgroundColor, | ||||
|                 DebugMode = debugMode, | ||||
|                 GoogleKeys = googleKeys, | ||||
|                 AppleRootCerts = appleRootCerts, | ||||
|  |  | |||
|  | @ -239,6 +239,10 @@ namespace Guru | |||
|         /// </summary> | ||||
|         internal static void StartAdService(AdsInitSpec spec = null) | ||||
|         { | ||||
|              | ||||
|             //---------- Using InitConfig ---------- | ||||
|             if (InitConfig is { IsBuyNoAds: true }) SetBuyNoAds(true); | ||||
| 
 | ||||
|             LogI($"StartAdService"); | ||||
|             if (spec == null) | ||||
|             { | ||||
|  | @ -248,14 +252,19 @@ namespace Guru | |||
|                     spec = AdsInitSpec.BuildWithNoAds(InitConfig.AutoLoadWhenAdsReady, IsDebugMode); | ||||
|                 } | ||||
|             } | ||||
|             ADService.Instance.StartService(OnAdsInitComplete, spec); | ||||
|              | ||||
|             //--------- Callbacks ----------- | ||||
|             if(InitConfig != null && !string.IsNullOrEmpty(InitConfig.BannerBackgroundColor))  | ||||
|                 spec.bannerColorHex = InitConfig.BannerBackgroundColor; | ||||
|              | ||||
|             //--------- Add Callbacks ----------- | ||||
|             ADService.OnBannerLoaded = OnBannerLoaded; | ||||
|             ADService.OnInterstitialLoaded = OnInterstitialLoaded; | ||||
|             ADService.OnInterstitialFailed = OnInterstitialFailed; | ||||
|             ADService.OnRewardLoaded = OnRewardLoaded; | ||||
|             ADService.OnRewardFailed = OnRewardFailed; | ||||
|              | ||||
|             // ---------- Start Services ---------- | ||||
|             ADService.Instance.StartService(OnAdsInitComplete, spec); | ||||
|         } | ||||
|          | ||||
|         private static void OnBannerLoaded()  | ||||
|  |  | |||
|  | @ -92,12 +92,15 @@ namespace Guru | |||
|             bool iapEnabled = true,  | ||||
|             bool autoRecordFinishedLevels = true,  | ||||
|             bool debugMode = false, | ||||
|             bool isBuyNoAds = false, | ||||
|             string bannerColor = "#00000000", | ||||
|             Dictionary<string, object> defaultRemoteData = null, | ||||
|             byte[] googleKeys = null, | ||||
|             byte[] appleRootCerts = null) | ||||
|         { | ||||
|             var config = GuruSDKInitConfig.Build(useCustomConsent, autoLoadAds, iapEnabled,  | ||||
|                 autoRecordFinishedLevels, debugMode, defaultRemoteData, googleKeys, appleRootCerts); | ||||
|                 autoRecordFinishedLevels, isBuyNoAds, bannerColor, | ||||
|                 debugMode, defaultRemoteData, googleKeys, appleRootCerts); | ||||
|             return config; | ||||
|         } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue