StatusForZone() public static method

public static StatusForZone ( string zone_id ) : string
zone_id string
return string
Ejemplo n.º 1
0
		private bool IsRewardAdAvailable(StoreInfo al) {
			bool retValue = false;
			MyDebug.Log(false, "AdsMCG::IsRewardAdAvailable => IsReward Ad Available Called");

			switch(al.ShowAdsFrom) {
#if ADCOLONY
			case Provider.AdColony:
				string rawStatus, status;
				rawStatus = AdColony.StatusForZone (al.AdColonyZone);
				status = string.Format ("Zone {0} status is {1}", al.AdColonyZone, rawStatus);
				MyDebug.Log (false,status);
				retValue = AdColony.IsVideoAvailable (al.AdColonyZone);
				break;
#endif

#if ADMOB
			case Provider.AdMob:
				retValue = GoogleMobileAdsScript.Me.IsRewardVideoAdReady(al.AdMobUnitID);
				//if(!retValue) GoogleMobileAdsScript.Me.RequestRewardVideoAd(al.AdMobUnitID);
				break;
#endif

#if CHARTBOOST
			case Provider.Chartboost:
				retValue = Chartboost.hasRewardedVideo(new CBLocation(al.CBLoation));
				if(!retValue) Chartboost.cacheRewardedVideo(new CBLocation(al.CBLoation));
				break;
#endif
			case Provider.Inmobi:
			default:
				break;
			}
			return retValue;
		}
Ejemplo n.º 2
0
		private void ShowInterstitialAd(StoreInfo al) {
			MyDebug.Log(false, "AdsMCG::ShowInterstitialAd => Show Interstitial Ad Called");
			switch(al.ShowAdsFrom) {
#if ADCOLONY
			case Provider.AdColony:
				string rawStatus, status;
				rawStatus = AdColony.StatusForZone (al.AdColonyZone);
				status = string.Format ("Zone {0} status is {1}", al.AdColonyZone, rawStatus);
				MyDebug.Log (false,status);
				if (AdColony.IsVideoAvailable (al.AdColonyZone)) {
					ShowAdColonyAds (al.AdColonyZone);
				}
				break;
#endif

#if ADMOB
			case Provider.AdMob:
				if(GoogleMobileAdsScript.Me.IsInterstitialReady(al.AdMobUnitID)) {
					ShowAdMobAds(al.AdMobUnitID);
				}
				break;
#endif

#if CHARTBOOST
			case Provider.Chartboost:
				if(Chartboost.hasInterstitial(new CBLocation(al.CBLoation))) {
					ShowChartboostAds(al.CBLoation);
				}
				break;
#endif
			case Provider.Inmobi:
				break;

			}
		}
 public void PlayAdColonyVideo()
 {
     Debug.Log("Status for zone: " + AdColony.StatusForZone(this.zoneId1));
     if (AdColony.IsVideoAvailable(this.zoneId1))
     {
         Debug.Log("Playing AdColony Video1");
         AdColony.ShowVideoAd(this.zoneId1);
     }
     else
     {
         Debug.Log("Video1 is not Not Available");
     }
 }
Ejemplo n.º 4
0
		private void ShowRewardAd(StoreInfo al) {
			MyDebug.Log(false, "AdsMCG::ShowRewardAd => Show Reward Ads Called");
			switch(al.ShowAdsFrom) {
#if ADCOLONY
			case Provider.AdColony:
				string rawStatus, status;
				rawStatus = AdColony.StatusForZone (al.AdColonyZone);
				status = string.Format ("Zone {0} status is {1}", al.AdColonyZone, rawStatus);
				MyDebug.Log (false,status);
				if (AdColony.IsVideoAvailable (al.AdColonyZone)) {
					ShowAdColonyAds (al.AdColonyZone);
				} else {
					NotificationCenter.Me.PostNotification (new Notification (this, "AdsFail", "AdColony"));
				}
				break;
#endif

#if ADMOB
			case Provider.AdMob:
				if(GoogleMobileAdsScript.Me.IsRewardVideoAdReady(al.AdMobUnitID)) {
					ShowAdMobRewardAds(al.AdMobUnitID);
				} else {
					NotificationCenter.Me.PostNotification(new NotificationInfo(this, "AdsFail", "AdMob"));
				}
				break;
#endif

#if CHARTBOOST
			case Provider.Chartboost:
				if(Chartboost.hasRewardedVideo(new CBLocation(al.CBLoation))) {
					ShowCBRewardAd(al.CBLoation);
				} else {
					NotificationCenter.Me.PostNotification(new NotificationInfo(this, "AdsFail", "Chartboost"));
				}
				break;
#endif
			case Provider.Inmobi:
				break;

			}
		}
    private void OnGUI()
    {
        GUI.skin = this.guiSkin;

        if (this.paused)
        {
            return;
        }

        if (GUI.Button(this.changeSceneRect, this.changeSceneText))
        {
            if (Application.loadedLevelName == "ACUBasic")
            {
                this.changeSceneText = "Change To Scene 1";
                Application.LoadLevel("ACUScene2");
            }
            else
            {
                this.changeSceneText = "Change To Scene 2";
                Application.LoadLevel("ACUBasic");
            }
        }

        if (GUI.Button(this.videoRect1, this.videoText1))
        {
            Debug.Log("Status for zone: " + AdColony.StatusForZone(this.zoneId1));
            if (AdColony.IsVideoAvailable(this.zoneId1))
            {
                Debug.Log("Play AdColony Video1");
                AdColony.ShowVideoAd(this.zoneId1);
            }
            else
            {
                Debug.Log("Video1 Not Available");
            }
        }

        if (GUI.Button(this.videoRect2, this.videoText2))
        {
            if (AdColony.IsVideoAvailable(this.zoneId2))
            {
                Debug.Log("Play AdColony Video2");
                AdColony.ShowVideoAd(this.zoneId2);
            }
            else
            {
                Debug.Log("Video2 Not Available");
            }
        }

        if (GUI.Button(this.v4vcRect, this.v4vcText))
        {
            if (AdColony.IsV4VCAvailable(this.v4vcId))
            {
                Debug.Log("Do V4VC");
                AdColony.OfferV4VC(true, this.v4vcId);
            }
            else
            {
                Debug.Log("V4VC Not Available");
            }
        }

        if (Application.loadedLevelName == "ACUBasic")
        {
            this.changeSceneText = "Change To Scene 2";
        }
        else
        {
            this.changeSceneText = "Change To Scene 1";
        }
        if (AdColony.IsVideoAvailable(this.zoneId1))
        {
            GUI.Box(this.statusIconRect1, this.iconReady);
            GUI.Label(this.statusLabelRect1, this.videoReadyText1);
        }
        else
        {
            GUI.Box(this.statusIconRect1, this.iconNotReady);
            GUI.Label(this.statusLabelRect1, this.videoNotReadyText1);
        }

        if (AdColony.IsVideoAvailable(this.zoneId2))
        {
            GUI.Box(this.statusIconRect2, this.iconReady);
            GUI.Label(this.statusLabelRect2, this.videoReadyText2);
        }
        else
        {
            GUI.Box(this.statusIconRect2, this.iconNotReady);
            GUI.Label(this.statusLabelRect2, this.videoNotReadyText2);
        }

        if (AdColony.IsV4VCAvailable(this.v4vcId))
        {
            GUI.Box(this.v4vcIconRect, this.iconReady);
            GUI.Label(this.v4vcLabelRect, this.v4vcReadyText);
        }
        else
        {
            GUI.Box(this.v4vcIconRect, this.iconNotReady);
            GUI.Label(this.v4vcLabelRect, this.v4vcNotReadyText);
        }

        GUI.Label(this.currencyBarRect, "Currency: " + this.currency);

        GUI.Box(this.brandStampRect, this.brandStamp);
    }