public void LoadAndShowAd() { if (DataManager.isLocalTestMode) { HandleUserEarnedReward(); HandleAdClosed(); return; } if (adInProcces) { return; } adInProcces = true; statusText.text = "Loading ad..."; isNeedToShow = false; statusPanel.SetActive(true); if (RewardedAdManager.isLoaded) { RewardedAdManager.ShowAd(); } else if (RewardedAdManager.isLoading) { isNeedToShow = true; } else { isNeedToShow = true; RewardedAdManager.CreateAndRequestAd(); } }
public void LoadAndShowAd(float delay) { if (DataManager.isLocalTestMode) { HandleUserEarnedReward(); HandleAdClosed(); return; } if (adInProcces) { return; } adInProcces = true; statusText.text = "Loading ad..."; isNeedToShow = false; statusPanel.SetActive(true); if (!RewardedAdManager.isLoaded && !RewardedAdManager.isLoading) { RewardedAdManager.CreateAndRequestAd(); } StartCoroutine(LoadAndShowWithDelay(delay)); }
private IEnumerator LoadAndShowWithDelay(float delay) { yield return(new WaitForSeconds(delay)); if (RewardedAdManager.isLoaded) { RewardedAdManager.ShowAd(); } else if (RewardedAdManager.isLoading) { isNeedToShow = true; } else { isNeedToShow = true; RewardedAdManager.CreateAndRequestAd(); } }
private void InitializeServices() { GPGSManager.Initialize(false); FirestoreManager.Initialize(); IAPManager.Initialize((status) => purchasesIsReady = true); MobileAds.Initialize((status) => { RequestConfiguration requestConfiguration = new RequestConfiguration.Builder().SetMaxAdContentRating(_maxAdContentRating).build(); MobileAds.SetRequestConfiguration(requestConfiguration); RewardedAdManager.CreateAndRequestAd(); InterstitialAdManager.CreateAndRequestAd(); adsIsReady = true; }); }