update: 更新广告服务的生命周期回调
parent
62bf31437f
commit
019869253c
|
|
@ -132,6 +132,31 @@ namespace Guru
|
|||
set => Model.BuyNoAds = value;
|
||||
}
|
||||
|
||||
#region Lifecycele
|
||||
|
||||
|
||||
private bool _isBannerSetToShow = false;
|
||||
public void OnAppPaused(bool paused)
|
||||
{
|
||||
if (paused)
|
||||
{
|
||||
if (IsBannerVisible)
|
||||
{
|
||||
_isBannerSetToShow = true;
|
||||
HideBanner();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_isBannerSetToShow)
|
||||
{
|
||||
_isBannerSetToShow = false;
|
||||
ShowBanner();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ILRD
|
||||
|
||||
|
|
@ -222,7 +247,7 @@ namespace Guru
|
|||
private string _badsCategory;
|
||||
protected float _badsloadStartTime = 0;
|
||||
private bool _bannerVisible = false;
|
||||
|
||||
public bool IsBannerVisible => _bannerVisible;
|
||||
|
||||
private int GetAdsLoadDuration(ref float startTime)
|
||||
{
|
||||
|
|
@ -293,7 +318,6 @@ namespace Guru
|
|||
MaxSdk.HideBanner(GetBannerID());
|
||||
MaxSdk.StopBannerAutoRefresh(GetBannerID());
|
||||
_bannerVisible = false;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue