update: 添加IV广告和 RV 广告的关闭回调事件

dev
胡宇飞 2024-07-02 12:36:15 +08:00
parent 3be05511e4
commit d89de67e44
2 changed files with 29 additions and 6 deletions

View File

@ -351,10 +351,12 @@ namespace Guru
ADService.OnInterstitialStartLoad = OnInterstitialStartLoad; ADService.OnInterstitialStartLoad = OnInterstitialStartLoad;
ADService.OnInterstitialLoaded = OnInterstitialLoaded; ADService.OnInterstitialLoaded = OnInterstitialLoaded;
ADService.OnInterstitialFailed = OnInterstitialFailed; ADService.OnInterstitialFailed = OnInterstitialFailed;
ADService.OnInterstitialClosed = OnInterstitialClosed;
// RADS // RADS
ADService.OnRewardedStartLoad = OnRewardedStartLoad; ADService.OnRewardedStartLoad = OnRewardStartLoad;
ADService.OnRewardLoaded = OnRewardedLoaded; ADService.OnRewardLoaded = OnRewardLoaded;
ADService.OnRewardFailed = OnRewardedFailed; ADService.OnRewardFailed = OnRewardFailed;
ADService.OnRewardClosed = OnRewardClosed;
// ---------- Start Services ---------- // ---------- Start Services ----------
ADService.Instance.StartService(OnAdsInitComplete, spec); ADService.Instance.StartService(OnAdsInitComplete, spec);
@ -383,12 +385,16 @@ namespace Guru
=> Callbacks.Ads._onInterstitialADLoaded?.Invoke(); => Callbacks.Ads._onInterstitialADLoaded?.Invoke();
private static void OnInterstitialFailed() private static void OnInterstitialFailed()
=> Callbacks.Ads._onInterstitialADFailed?.Invoke(); => Callbacks.Ads._onInterstitialADFailed?.Invoke();
private static void OnRewardedStartLoad(string adUnitId) private static void OnInterstitialClosed()
=> Callbacks.Ads._onInterstitialADClosed?.Invoke();
private static void OnRewardStartLoad(string adUnitId)
=> Callbacks.Ads._onRewardedADStartLoad?.Invoke(adUnitId); => Callbacks.Ads._onRewardedADStartLoad?.Invoke(adUnitId);
private static void OnRewardedLoaded() private static void OnRewardLoaded()
=> Callbacks.Ads._onRewardedADLoaded?.Invoke(); => Callbacks.Ads._onRewardedADLoaded?.Invoke();
private static void OnRewardedFailed() private static void OnRewardFailed()
=> Callbacks.Ads._onRewardADFailed?.Invoke(); => Callbacks.Ads._onRewardADFailed?.Invoke();
private static void OnRewardClosed()
=> Callbacks.Ads._onRewardADClosed?.Invoke();
private static void OnAdsInitComplete() private static void OnAdsInitComplete()
{ {

View File

@ -73,6 +73,7 @@ namespace Guru
remove => _onAdsInitComplete -= value; remove => _onAdsInitComplete -= value;
} }
//------------ BANNER -----------------
internal static Action<string> _onBannerADStartLoad; internal static Action<string> _onBannerADStartLoad;
public static event Action<string> OnBannerADStartLoad public static event Action<string> OnBannerADStartLoad
{ {
@ -87,6 +88,7 @@ namespace Guru
remove => _onBannerADLoaded -= value; remove => _onBannerADLoaded -= value;
} }
//------------ INTER -----------------
internal static Action<string> _onInterstitialADStartLoad; internal static Action<string> _onInterstitialADStartLoad;
public static event Action<string> OnInterstitialADStartLoad public static event Action<string> OnInterstitialADStartLoad
{ {
@ -108,6 +110,14 @@ namespace Guru
remove => _onInterstitialADFailed -= value; remove => _onInterstitialADFailed -= value;
} }
internal static Action _onInterstitialADClosed;
public static event Action OnInterstitialADClosed
{
add => _onInterstitialADClosed += value;
remove => _onInterstitialADClosed -= value;
}
//------------ REWARD -----------------
internal static Action<string> _onRewardedADStartLoad; internal static Action<string> _onRewardedADStartLoad;
public static event Action<string> OnRewardedADStartLoad public static event Action<string> OnRewardedADStartLoad
{ {
@ -122,6 +132,13 @@ namespace Guru
remove => _onRewardedADLoaded -= value; remove => _onRewardedADLoaded -= value;
} }
internal static Action _onRewardADClosed;
public static event Action OnRewardedADClosed
{
add => _onRewardADClosed += value;
remove => _onRewardADClosed -= value;
}
internal static Action _onRewardADFailed; internal static Action _onRewardADFailed;
public static event Action OnRewardADFailed public static event Action OnRewardADFailed
{ {