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 HandleAdLoaded() { if (isNeedToShow) { RewardedAdManager.ShowAd(); isNeedToShow = false; } }
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(); } }