I just finished my first game and I’m trying to practice how to put admobs in it. I just want to make sure that I don’t call it multiple times with my code because I read that I might get in trouble for that.
Here’s my code:
void Start () {
admob = GetComponent<AdMobPlugin>();
admob.CreateBanner(AD_UNIT_ID, AdMobPlugin.AdSize.SMART_BANNER, false, "", false);
admob.RequestAd();
admob.ShowBanner();
}
// Update is called once per frame
void Update () {
if (Application.loadedLevelName == "Stage")
{
if (!hidden)
{
admob.HideBanner();
hidden = true;
}
}
else if (Application.loadedLevelName != "Stage")
{
if (hidden)
{
admob.ShowBanner();
hidden = false;
}
}
}