I played around with your sample too bit and so I think it'll be easier to explain what I changed than to send a .unitypackage back.
Since you need to hold a reference to a banner between scenes, we'll create a special GameObject to hold on to, and attach ads related behaviors to that GameObject.
// MainMenuAdControl.cs
void Start() {
// Create an empty GameObject to hold the banner. Attach ads behavior to it, and don't destroy it when new scenes load.
GameObject myGameObject = new GameObject("myGameObject");
myGameObject.AddComponent();
DontDestroyOnLoad(myGameObject);
}
My BannerControl.cs looks like this:
// BannerControl.cs
using System;
using UnityEngine;
using GoogleMobileAds;
using GoogleMobileAds.Api;
public class BannerControl : MonoBehaviour {
public BannerView bannerView;
void Start()
{
bannerView = new BannerView("your_ad_unit_id", AdSize.SmartBanner, AdPosition.Bottom);
AdRequest request = new AdRequest.Builder().Build();
bannerView.LoadAd (request);
bannerView.Show();
}
}
Then in your GameAdControl.cs, which is attached to the second scene, find the GameObject, get the BannerControl component, and you have access to the BannerView:
// GameAdControl.cs
void Start () {
GameObject myGameObject = GameObject.Find("myGameObject");
BannerControl bannerControl = myGameObject.GetComponent();
bannerControl.bannerView.Hide();
}
From a Unity perspective, it's probably better to have a different GameObject just for ads, so you're only holding onto that GameObject through scenes, and not the entire main menu GameObject.
Hope this helps,
Eric