update: 更新广告服务的生命周期回调

deeplink
胡宇飞 2024-04-17 19:56:42 +08:00
parent 62bf31437f
commit 019869253c
1 changed files with 26 additions and 2 deletions

View File

@ -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>