AdManager.showInterstitial C# (CSharp) Méthode

showInterstitial() public méthode

public showInterstitial ( ) : void
Résultat void
        public void showInterstitial(){
          if ((loadCount % 3) == 0)  // only show ad every third time
          {
            if (this.interstitial.IsLoaded())
            {
                this.interstitial.Show();
            }
         }
        
    }

Usage Example

Exemple #1
0
    void OnGUI()
    {
        // Puts some basic buttons onto the screen.
        GUI.skin.button.fontSize = (int)(0.05f * Screen.height);

        Rect requestBannerRect = new Rect(0.1f * Screen.width, 0.05f * Screen.height,
                                          0.8f * Screen.width, 0.1f * Screen.height);

        if (GUI.Button(requestBannerRect, "Initialize"))
        {
            Debug.Log("AdManager initialization");

            AdManager.initialize();
            AdManager.setInterstitialCallbacks(this);
            AdManager.setVideoCallbacks(this);
        }

        Rect showInterstitialRect = new Rect(0.1f * Screen.width, 0.175f * Screen.height,
                                             0.8f * Screen.width, 0.1f * Screen.height);

        if (GUI.Button(showInterstitialRect, "Show Interstitial"))
        {
            AdManager.showInterstitial();
        }

        Rect showVideoRect = new Rect(0.1f * Screen.width, 0.3f * Screen.height,
                                      0.8f * Screen.width, 0.1f * Screen.height);

        if (GUI.Button(showVideoRect, "Show Video"))
        {
            AdManager.showRewardedVideo();
        }
    }