private void OnDestroy() { if (Instance == this) { Instance = null; } DetachAdView(); CASFactory.UnsubscribeReadyManagerAsync(OnManagerReady, managerId.index); }
private void OnDestroy() { if (manager != null) { manager.OnLoadedAd -= OnInterstitialAdLoaded; manager.OnFailedToLoadAd -= OnInterstitialAdFailedToLoad; manager.OnInterstitialAdFailedToShow -= OnAdFailedToShow.Invoke; manager.OnInterstitialAdShown -= OnAdShown.Invoke; manager.OnInterstitialAdClicked -= OnAdClicked.Invoke; manager.OnInterstitialAdClosed -= OnAdClosed.Invoke; } CASFactory.UnsubscribeReadyManagerAsync(OnManagerReady, managerId.index); }