Hello Everyone,
I am trying to add AdMob Interstitial Ads in my android Game. i’ve downloaded & Integrated the Latest AdMob Plugin.
so, i’ve made a Empty GameObject and named it Ad_Manager, and have added a AdManager Script to it.
Now, in that AdManager Script i’ve written This Code
using System.Collections;
using UnityEngine;
using GoogleMobileAds.Api;
using System;
public class AdManager : MonoBehaviour
{
InterstitialAd interstitial;
public static AdManager instance;
void Awake()
{
instance = this;
RequestInterstitial();
}
void Start()
{
Show();
}
public void RequestInterstitial()
{
string adUnitId = "ca-app-pub-3940256099942544/1033173712";
interstitial = new InterstitialAd(adUnitId);
AdRequest request = new AdRequest.Builder().Build();
interstitial.LoadAd(request);
}
public void Show()
{
Debug.Log("showing ads");
if (interstitial.IsLoaded())
{
interstitial.Show();
}
}
}
And i am calling the Show method from Different Script using Singleton like this.
AdManager.instance.Show();
so where am i doing the mistake, Any help will be appreciated, Thanks