Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Ground Controller Lvl 1
Message 1 of 1

Interstitial show

can you help me change.  To repeat in 40 seconds

 

 

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

public class Interstitial : MonoBehaviour

{
    InterstitialAd interstitial;

    // Use this for initialization

    void Start()
    {
#if UNITY_ANDROID
        string appId = "Admob ID";
#elif UNITY_IPHONE
            string appId = "ca-app-pub-3940256099942544~1458002511";
#else
        string appId = "unexpected_platform";
#endif

        // Initialize the Google Mobile Ads SDK.
        MobileAds.Initialize(appId);


    
    
        
    
#if UNITY_ANDROID
    string adUnitId = "ca-app-pub-3940256099942544/1033173712";
#elif UNITY_IPHONE
        string adUnitId = "ca-app-pub-3940256099942544/4411468910";
#else
        string adUnitId = "unexpected_platform";
#endif

        // Initialize an InterstitialAd.
        this.interstitial = new InterstitialAd(adUnitId);



        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder()
            .AddTestDevice("2077ef9a63d2b398840261c8221a0c9b")
            .Build();
        // Load the interstitial with the request.
        this.interstitial.LoadAd(request);



    }

    void Update()

    {

        if (this.interstitial.IsLoaded())

        {
            this.interstitial.Show();


        }

                


    }

    void OnDestroy()
    {

        interstitial.Destroy(); //Destroy

        
    }


}