Disable ad

Hello , I have a problem with deleting my ad banner at the bottom of the screen. I have one scene with gameplay only and after players death I have some buttons (restart, main menu , quit) so I added my banner script to empty gameobject and it turns on after death. But when I click restart or main menu the banner stays at the bottom of the screen. I know I have to delete it somehow, but I don’t know when and how. I want to banner disappear when players click main menu or restart. I’m using test ad id.
Thank you guys for your time.
Here is my code :

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

public class Admob : MonoBehaviour
{

    // Use this for initialization
    void Start()
    {
        //Request Ads
        RequestBanner();

    }

    private void RequestBanner()
    {
#if UNITY_EDITOR
        string adUnitId = "unused";
#elif UNITY_ANDROID
        string adUnitId = "ca-app-pub-3940256099942544/6300978111";
#elif UNITY_IPHONE
        string adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE";
#else
        string adUnitId = "unexpected_platform";
#endif

        // Create a 320x50 banner at the bottom of the screen.
        BannerView bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Bottom);
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();
        // Load the banner with the request.
        bannerView.LoadAd(request);

    }

}

I would say if you have a LoadAd, there may be an UnloadAd. Usually if I’m working with a new sdk and trying to figure out what is available without wanting to look at the docs, I just see what comes up when I hit the dot after the instance.

So, type in bannerView. and see what methods are available. You might just find what you are looking for. Otherwise I’m sure you could browse the google docs for what they have for ads.