public void ShowTestUI(bool useClickCounter) { if (useClickCounter) { if (Time.realtimeSinceStartup - _testUILastClickTime <= 0.5f) { _testUIClicks++; } else { _testUIClicks = 0; } _testUILastClickTime = Time.realtimeSinceStartup; if (_testUIClicks >= 5) { _testUIClicks = 0; ShowTestUI(false); } } else { IAdsWrapperInterface wrapper = Wrapper; if (wrapper != null) { wrapper.ShowTestUI(); } } }
public void ShowRewardedVideo(string tag, Action callback, Action <int> rewardCallback, int productID) { IAdsWrapperInterface wrapper = Wrapper; bool adStarted = false; if (wrapper != null) { adStarted = true; _interstitialClosedCallback = callback; _rewardCallback = rewardCallback; _rewardProductID = productID; LogRewardAnalytics("start", tag); EventManager.SendEvent(IDs.Events.DisableMusicDuringAd); #if UNITY_EDITOR DelayedCall.Create(OnGrantReward, 2f); #else wrapper.ShowRewardedVideo(tag); #endif } if (!adStarted && callback != null) { callback(); } callback = null; rewardCallback = null; }
private void ShowIntersitital(string tag, Action callback, bool useBetweenLevelCounter, bool usePromoCounter, GameObject adBlockObject) { IAdsWrapperInterface wrapper = Wrapper; bool adStarted = false; if (Enabled && wrapper != null) { if (useBetweenLevelCounter) { Manager.State.IncreaseInterstitialCounter(); } bool allowed = true; if (useBetweenLevelCounter) { allowed = CanDisplayBetweenLevelAd; if (allowed) { Manager.State.ResetInterstitialCounter(); } } if (usePromoCounter) { allowed = CanDisplayPromo; if (allowed) { Manager.State.RegisterPromoDisplay(); } } if (allowed) { if (adBlockObject != null) { _adBlockObject = adBlockObject; _adBlockObject.SetActive(true); } adStarted = true; _interstitialClosedCallback = callback; EventManager.SendEvent(IDs.Events.DisableMusicDuringAd); #if UNITY_EDITOR DelayedCall.Create(OnInterstitialClosed, 2f); #else wrapper.ShowIntersitital(tag); #endif } } if (!adStarted && callback != null) { callback(); } callback = null; }
public void ShowBanner(string tag) { IAdsWrapperInterface wrapper = Wrapper; if (Enabled && wrapper != null) { wrapper.ShowBanner(tag); } }
public void HideBanner() { IAdsWrapperInterface wrapper = Wrapper; if (wrapper != null) { wrapper.HideBanner(); } }
public bool IsBannerVisible() { IAdsWrapperInterface wrapper = Wrapper; if (Enabled && wrapper != null) { return(wrapper.IsBannerVisible()); } else { return(false); } }
public float GetBannerHeight() { IAdsWrapperInterface wrapper = Wrapper; if (Enabled && wrapper != null) { return(wrapper.GetBannerHeight()); } else { return(0f); } }
public void CacheRewardVideos(string tag, bool force, params string[] otherTags) { if (_rewardVideosCached && !force) { return; } IAdsWrapperInterface wrapper = Wrapper; if (wrapper != null) { wrapper.CacheRewardedVideo(tag); foreach (string otherTag in otherTags) { wrapper.CacheRewardedVideo(otherTag); } } _rewardVideosCached = true; }
public void CacheIntersitials(string tag, params string[] otherTags) { if (_interstitialsCached) { return; } IAdsWrapperInterface wrapper = Wrapper; if (Enabled && wrapper != null) { wrapper.CacheInterstitial(tag); foreach (string otherTag in otherTags) { wrapper.CacheInterstitial(otherTag); } } _interstitialsCached = true; }