In my game I want to show interstitials when someone loses. I had banner ads working great, but then I changed my code to adjust for interstitials, and now it takes a while for my banner ad to show up, and when it does it lags for a second. I also am having trouble figuring out how to get my interstitials to pop up and then request another one. I have an ad manager and the way I am telling my game when to display an ad is when the death screen pops up, then an ad should be displayed, and when the death screen goes away, I want to request another ad. So far, I haven't been able to get it to work. Here is my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GoogleMobileAds.Api;
public class AdManager : MonoBehaviour {
//public bool dead;
public int showAd;
public InterstitialAd interstitial;
public BannerView bannerView;
void Start () {
RequestBanner ();
showAd = Random.Range (1, 3);
RequestInterstitial ();
}
void Awake () {
DontDestroyOnLoad (this);
}
void Update () {
}
void ShowInterstitial () {
if (GameObject.Find ("Canvas1").GetComponent
↧