public void OnUnityAdsReady(string placementId) { if (placementId == _adsConfig.ReviveVideoPlacementId) { ReviveAdvertisementUpdate?.Invoke(true); } else if (placementId == _adsConfig.BonusVideoPlacementId) { BonusAdvertisementUpdate?.Invoke(true); } else if (placementId == _adsConfig.BannerPlacementId && !CloudVariables.IsAdsRemoved() && _uiService.CurrentPanel is MainMenuController) { Advertisement.Banner.Show(_adsConfig.BannerPlacementId); } }
private void ExitToMainMenu() { if (!CloudVariables.IsAdsRemoved()) { _adsService.ShowGameOverAdvertisement(); } SetActivePanel(false); _gameDataService.SetLastLevel(_levelService.Level); _gameDataService.UpdateCloudVariables(); _playGamesService.SaveData(); _bonusButton.gameObject.SetActive(true); MapGenerator.Instance.ResetGenerator(); _levelService.UpdateService(); _uiService.UpdateMainMenu(); _uiService.ExitToMainMenu(); }
private void SetActive(bool isActive) { SetActivePanel(isActive); if (isActive) { _uiService.CurrentPanel = this; _adsService.HideBanner(); _tutorStartButton.gameObject.SetActive(_tutorStartButton.gameObject.activeInHierarchy); } else { if (!CloudVariables.IsAdsRemoved()) { _adsService.ShowBanner(); } } }
private void Awake() { _removeAdsButton = GetComponent <Button>(); _adsService = ServiceLocator.GetService <AdsService>(); if (CloudVariables.IsAdsRemoved()) { DestroyButton(); return; } // if (IAPManager.Instance.AreAdsRemoved()) // { // DestroyButton(); // return; // } _removeAdsButton.onClick.AddListener(RemoveAds); if (_text != null) { _text.text = IAPManager.Instance.GetRemoveAdsPrice(); } }