void Awake() { _videoAd = this; if (PlayerPrefs.HasKey("RemoveAdsActivated")) { showAds = false; } else { showAds = true; PlayerPrefs.SetInt("RemoveAdsActivated", 0); } if (!showAds) { return; } // Initialize the Ads listener and service: Advertisement.AddListener(this); Advertisement.Initialize(gameId, testMode); IsAdReady(); }
private static void ShowAdIfCounter() { _adCounter++; if (_adCounter < 4) { return; } _adCounter = 0; Debug.Log("request show ad"); UnityVideoAds.ShowAd(); }