Friday, May 10, 2019

Unity 3d show Interstitial Ad full script by allunityscripts

Show Interstitial Ad

how to show Interstitial Ad

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GoogleMobileAds.Api;

public class Ad : MonoBehaviour
{
 public string InterstitialAdID;

InterstitialAd MyinterstitialAd;

private void start()
{
MyinterstitialAd = new InterstitialAd(InterstitialAdID);
}

public void LoadInterstitialAd ()
{
AdRequest requeset = new AdRequest.Builder().Build();
MyinterstitialAd.LoadAd(requeset);
}

public void showInterstitialAd()
{
if (MyinterstitialAd.IsLoaded())
{
     MyinterstitialAd.Show();
}
else
{
     LoadInterstitialAd();
}
}
}

No comments:

Post a Comment