private void OnAdmobClick() { CAdmobManager.OnVideoAdsReward -= this.OnHandleRewardAddGold; if (CGameSetting.IsTimerToAd(CGameSetting.DELAY_TO_AD)) { CAdmobManager.OnVideoAdsReward += this.OnHandleRewardAddGold; CAdmobManager.ShowRewardedVideo(); CGameSetting.ResetTimerToAd(); this.m_AdmobButton.interactable = false; } CSoundManager.Instance.Play("sfx_click"); // ADS SHOWING. CGameSetting.IS_ADS_SHOW_ON_SCREEN = true; }
public override void OnInitObject() { base.OnInitObject(); // INIT SOCKET CSocketManager.Instance.Init(); CPlayerManager.GetInstance(); // ADMOB CAdmobManager.Init(); CAdmobManager.InitBanner(); CAdmobManager.InitRewardedVideo(); CAdmobManager.LoadBanner(); CAdmobManager.LoadRewardedVideo(); if (CGameSetting.HasTimeToAd() == false) { CGameSetting.ResetTimerToAd(); } // EVENTS CSocketManager.Instance.On("welcome", this.OnReceiveWelcome); }