ShowVideoAd() public static method

public static ShowVideoAd ( ) : bool
return bool
Exemplo n.º 1
0
    public void PlayAVideo(string adPlacement)
    {
        if (OnVideoStarted != null)
        {
            OnVideoStarted();
        }
        if (AdColony.IsVideoAvailable(adPlacement))
        {
            Debug.Log("Play a video");
            AdColony.ShowVideoAd(adPlacement);
        }
        else if (Supersonic.Agent.isRewardedVideoAvailable())
        {
            Debug.Log("Play a supersonic's video");
            Supersonic.Agent.showRewardedVideo(adPlacement);
        }
        else if (Advertisement.isReady(adPlacement))
        {
            ShowOptions options = new ShowOptions();
            options.resultCallback = AdCallbackHandler;
            Advertisement.Show(adPlacement, options);
        }

        else
        {
            Debug.Log("No video to show");
        }
    }
Exemplo n.º 2
0
    public static void ShowVideoAdByZoneKey(string zoneIdKey, bool offerV4VCBeforePlay = false, bool showPopUpAfter = false)
    {
        ADCVideoZone videoZone = GetVideoZoneObjectByKey(zoneIdKey);
        string       zoneId    = GetZoneIdByKey(zoneIdKey);

        if (IsVideoAvailableByZoneKey(zoneIdKey))
        {
            if (videoZone.zoneType == ADCVideoZoneType.Interstitial)
            {
                AdColony.ShowVideoAd(zoneId);
            }
            else if (videoZone.zoneType == ADCVideoZoneType.V4VC)
            {
                if (offerV4VCBeforePlay)
                {
                    AdColony.OfferV4VC(showPopUpAfter, zoneId);
                }
                else
                {
                    AdColony.ShowV4VC(showPopUpAfter, zoneId);
                }
            }
            else
            {
                //Check nothing, video zone type isn't correct
                Debug.Log("An incorrect video zone type was requested to play. Please resolve this issue.");
            }
            Debug.Log("The zone '" + zoneId + "' was requested to play.");
        }
        else
        {
            Debug.Log("The zone '" + zoneId + "' was requested to play, but it is NOT ready to play yet.");
        }
    }
Exemplo n.º 3
0
        public static void ShowVideoAdByZoneKey(string zoneIdKey, bool offerV4VCBeforePlay = false, bool showPopUpAfter = false)
        {
            ADCVideoZoneCustom videoZone = GetVideoZoneObjectByKey(zoneIdKey);
            string             zoneId    = GetZoneIdByKey(zoneIdKey);

            if (videoZone.zoneType == ADCVideoZoneTypeCustom.Interstitial && AdColony.IsVideoAvailable(zoneId))
            {
                AdColony.ShowVideoAd(zoneId);
            }
            else if (videoZone.zoneType == ADCVideoZoneTypeCustom.V4VC && AdColony.IsV4VCAvailable(zoneId))
            {
                if (offerV4VCBeforePlay)
                {
                    AdColony.OfferV4VC(showPopUpAfter, zoneId);
                }
                else
                {
                    AdColony.ShowV4VC(showPopUpAfter, zoneId);
                }
            }
            else
            {
                Debug.Log("AdColony ---- The zone '" + zoneId + "' was requested to play, but it is NOT ready to play yet.");
            }
        }
Exemplo n.º 4
0
 public void ShowVideoAds()
 {
     if (AdColony.IsVideoAvailable(adIds.ADCOLONY_InterstitialVideoZoneID))
     {
         bool showAds = AdColony.ShowVideoAd(adIds.ADCOLONY_InterstitialVideoZoneID);
         print("Ad Colony show interstitiazl video = " + showAds);
         return;
     }
     print("Ad Colony doesn't have interstitiazl video so don't show!!");
 }
Exemplo n.º 5
0
		private void ShowAdColonyAds(string zoneID) {
#if ADCOLONY
		if (AdColony.IsVideoAvailable (zoneID)) {
			AdColony.ShowVideoAd (zoneID);
		} else {
			MyDebug.Log (false,"AdsMCG::ShowAdColonyAds => Cache not Interstitialed");
			NotificationCenter.Me.PostNotification (new Notification (this, "AdsFail", "AdColony"));
		}
#endif
		}
Exemplo n.º 6
0
 /// <summary>
 /// This is the default logic to be performed on button pressed
 /// </summary>
 public override void PerformButtonPressLogic()
 {
     if (AdColony.IsVideoAvailable(zoneString))
     {
         Debug.Log(this.gameObject.name + " triggered playing a video ad.");
         AdColony.ShowVideoAd(zoneString);
     }
     else
     {
         Debug.Log(this.gameObject.name + " tried to trigger playing an ad, but the video is not available yet.");
     }
 }
Exemplo n.º 7
0
 public void PlayAVideo(string zoneID)
 {
     if (AdColony.IsVideoAvailable(zoneID))
     {
         Debug.Log("Play a video");
         AdColony.ShowVideoAd(zoneID);
     }
     else
     {
         Debug.Log("Video not avaiable");
     }
 }
 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");
     }
 }
 /// <summary>
 /// 동영상을 보여주는 함수
 /// </summary>
 public void ShowVideoAdmob()
 {
     if (AdColony.IsVideoAvailable(zoneString))
     {
         Debug.Log(this.gameObject.name + " triggered playing a video ad.");
         AdColony.ShowVideoAd(zoneString);
     }
     else
     {
         Debug.Log(this.gameObject.name + " tried to trigger playing an ad, but the video is not available yet.");
         UIManager.Inst.PopupMessage("adcolony not available yet!");
     }
 }
Exemplo n.º 10
0
 // When a video is available, you may choose to play it in any fashion you like.
 // Generally you will play them automatically during breaks in your game,
 // or in response to a user action like clicking a button.
 // Below is a method that could be called, or attached to a GUI action.
 public void PlayAVideo()
 {
     // Check to see if a video is available in the zone.
     if (AdColony.IsVideoAvailable(zoneID))
     {
         Debug.Log("Play AdColony Video");
         // Call AdColony.ShowVideoAd with that zone to play an interstitial video.
         // Note that you should also pause your game here (audio, etc.) AdColony will not
         // pause your app for you.
         AdColony.ShowVideoAd(zoneID);
     }
     else
     {
         Debug.Log("Video Not Available");
     }
 }
Exemplo n.º 11
0
    IEnumerator ShowingAds(AdNetwork network)
    {
        if (UIPanel.uiAnimation > 0)
        {
            yield return(0);
        }

        if (!IsReady(network) || lastShow + AdAssistant.Instance.ad_show_min_delay * 60 > Time.unscaledTime)
        {
            yield break;
        }

        lastShow = Time.unscaledTime;

        #if !UNITY_WEBGL
        switch (network)
        {
        case AdNetwork.UnityAds:
            Advertisement.Show(GetZoneId(network), new ShowOptions {
                resultCallback = result => {
                    if (result == ShowResult.Finished)
                    {
                        if (reward != null)
                        {
                            reward.Invoke();
                            reward = null;
                        }
                    }
                }
            });
            yield break;

        case AdNetwork.Chartboost:
            OnAdOpen();
            Chartboost.showInterstitial(CBLocation.Default);
            yield break;

        case AdNetwork.AdColony:
            AdColony.ShowVideoAd(GetZoneId(network));
            yield break;

        case AdNetwork.AdMob:
            AdMob_Interstitial.Show();
            yield break;
        }
        #endif
    }
Exemplo n.º 12
0
    // Mostra o video
    public override bool showVideo(VideoDelegate methodToCall)
    {
        try
        {
            if (Info.IsEditor() || Info.IsWeb() || !isVideoAvailable())
            {
                return(false);
            }

            callback = methodToCall;

            return(AdColony.ShowVideoAd());
        }
        catch
        {
            return(Error(API, ERROR_PLAY_VIDEO));
        }
    }
Exemplo n.º 13
0
 public override void show()
 {
     AdColony.ShowVideoAd(Adzones [0]);
 }
Exemplo n.º 14
0
    void DisplayRestartButton()
    {
        //Player dead

        int highScore = PlayerPrefs.GetInt("HighScore");

        //Run this portion only once
        if (!displayRan)
        {
            displayRan = true;

            float diceRoll  = Random.Range(0, 100);
            float threshold = 100f - (coins * 15);

            if ((diceRoll > threshold) && AdColony.IsVideoAvailable("vzff120c3f1c414eae9c"))
            {
                Debug.Log("Play AdColony Video");
                AdColony.ShowVideoAd("vzff120c3f1c414eae9c");
            }

            //Highscore
            newHigh = SetHighScore(coins);
        }

        //GUI

        Rect buttonRect = new Rect(swidth * 0.1f, sheight * 0.8f, swidth * 0.8f, sheight * 0.1f);

        //Again Button
        if (GUI.Button(new Rect(swidth * .1f, sheight * .75f, swidth * .8f, sheight * .15f),
                       againButton))
        {
            Application.LoadLevel(Application.loadedLevelName);
        }
        //Rest


        GUI.DrawTexture(new Rect(swidth * .1f, sheight * .35f, swidth * .8f, sheight * .3f),
                        scoreScreen);

        GUIStyle newStyle = new GUIStyle();

        newStyle.fontSize         = (int)swidth / 10;
        newStyle.fontStyle        = FontStyle.Bold;
        newStyle.normal.textColor = Color.yellow;
        newStyle.font             = (Font)Resources.Load("COMIC");

        Rect scoreLabelRect = new Rect(swidth * .26f, sheight * .475f, 10, 10);

        GUI.Label(scoreLabelRect, coins.ToString(), newStyle);

        Rect highLabelRect = new Rect(swidth * .645f, sheight * .475f, 10, 10);

        GUI.Label(highLabelRect, highScore.ToString(), newStyle);

        //Achievements(Awards) Button
        if (GUI.Button(new Rect(swidth * .1f, sheight * .175f, swidth * .35f, sheight * .10f),
                       awardsButton))
        {
            //first, authenticate
            Social.localUser.Authenticate((bool success) => {
                //handle sucess/failure
                if (success)
                {
                    Debug.Log("Log In Success");
                }
                else
                {
                    Debug.Log("Log In Failed");
                }
            });
            //then show
            Social.ShowAchievementsUI();
        }

        //Scores Button
        if (GUI.Button(new Rect(swidth * .55f, sheight * .175f, swidth * .35f, sheight * .10f),
                       scoresButton))
        {
            //first, authenticate
            Social.localUser.Authenticate((bool success) => {
                //handle sucess/failure
                if (success)
                {
                    Debug.Log("Log In Success");
                }
                else
                {
                    Debug.Log("Log In Failed");
                }
            });
            //then show
            ((PlayGamesPlatform)Social.Active).ShowLeaderboardUI("CgkIgbqWkoIcEAIQBg");
        }



        if (newHigh)
        {
            GUI.DrawTexture(new Rect(swidth * .574f, sheight * .57f, swidth * .2f, sheight * .04f),
                            newHighScore);
        }
    }
    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);
    }