// Use this for initialization void Awake() { if (instance != null) { Destroy(this.gameObject); return; } DontDestroyOnLoad(this.gameObject); instance = this; adsEnabled = true; if (areAdsAlreadyRemoved()) { disableAds(); } admobHandler = gameObject.AddComponent <AdmobHandler>(); chartboostHandler = gameObject.AddComponent <ChartboostHandler>(); if (InitializeNetworksOnStart) { InitializeNetworks(); } }
private static ChartboostHandler getInstance() { if (m_instance == null) { m_instance = new ChartboostHandler(); } return(m_instance); }
public void showInterstatial() { if (ZPlayerPrefs.GetInt("ads", 1) == 0) { return; } if (showInterstatialAdmob) { AdMobHandler.showAdmobInterstatial(); } else if (ChartboostHandler.isCached() && showInterstatialChartBoost) { ChartboostHandler.showInterstatialAd(); } }
void InitailizeAdNetworks() { if (showInterstatialChartBoost) { ChartboostHandler.initialize(); } if (showBannerAdmob && showInterstatialAdmob) { #if UNITY_IOS AdMobHandler.initialize(ad_mob_banner_id_ios, ad_mob_interstatial_id_ios); #endif #if UNITY_ANDROID AdMobHandler.initialize(ad_mob_banner_id_android, ad_mob_interstatial_id_android); #endif } else { if (showBannerAdmob) { #if UNITY_IOS AdMobHandler.initialize(ad_mob_banner_id_ios, ""); #endif #if UNITY_ANDROID AdMobHandler.initialize(ad_mob_banner_id_android, ""); #endif } else if (showInterstatialAdmob) { #if UNITY_IOS AdMobHandler.initialize("", ad_mob_interstatial_id_ios); #endif #if UNITY_ANDROID AdMobHandler.initialize("", ad_mob_interstatial_id_android); #endif } } }