- Home /
Admob code question
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;
}
}
}
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
A node in a childnode? 1 Answer
Distribute terrain in zones 3 Answers
Serializing strings to XML C# 1 Answer
new scene does not load when calling from HandleOnAdClosed callback of admob script 0 Answers