Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        if (j == 0 && GameManager.instance.isGameOver == true &&
            GameManager.instance.canShowAds)
        {
            j++;

            if (GameManager.instance.currentScore > 100 || (GameManager.instance.currentScore > 70 &&
                                                            GameManager.instance.currentScore >= GameManager.instance.hiScore))
            {
                if (video != null)
                {
                    video.ShowRewardedVideo();
                }
                else if (fullscreen != null)
                {
                    fullscreen.Show();
                }
            }
            else if (GameManager.instance.currentScore >= 3)
            {
                if (fullscreen != null)
                {
                    fullscreen.Show();
                }
            }
        }
    }
 protected void InterstitialLoaded(object obj, EventArgs e)
 {
     interstitialListener.OnInterstitialLoaded -= InterstitialLoaded;
     if (interstitial != null)
     {
         interstitial.Show();
     }
 }
    void OnGUI()
    {
        if (GUILayout.Button("Start Session"))
        {
                        #if !UNITY_EDITOR
            revmob = RevMob.Start(REVMOB_APP_IDS, gameObject.name);
                        #endif
        }
        if (GUILayout.Button("Create Intertitial"))
        {
                        #if !UNITY_EDITOR
            fullscreen = revmob.CreateFullscreen();
                        #endif
        }
        if (GUILayout.Button("Display Interstitial"))
        {
                        #if !UNITY_EDITOR
            if (fullscreen == null)
            {
                fullscreen = revmob.CreateFullscreen();
            }

            fullscreen.Show();
                        #endif
        }
        if (GUILayout.Button("Create Banner"))
        {
                        #if !UNITY_EDITOR
            loadedBanner = revmob.CreateBanner();
                        #endif
        }
        if (GUILayout.Button("Show Banner"))
        {
                        #if !UNITY_EDITOR
            loadedBanner.Show();
                        #endif
        }
        if (GUILayout.Button("Hide Banner"))
        {
                        #if !UNITY_EDITOR
            loadedBanner.Hide();
                        #endif
        }
    }