- Home /
How to show and hide ads, using admob.
Hi, I've managed to get my banner ads showing when i do a test run but i would like them to hide during gameplay. I've looked but there doesn't seem to be an answer i understand. How could i make sure that the banner ads show in some scenes and hide in other scenes? Here is the code i have:
private BannerView bannerView;
public void Start()
{
ShowBanner();
}
private void ShowBanner()
{
#if UNITY_ANDROID
string adUnitId = "place app id here";
#elif UNITY_IPHONE
string adUnitId = "null";
else
string adUnitId = "unexpected_platform";
#endif
bannerView = new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Top);
AdRequest request = new AdRequest.Builder().Build();
bannerView.LoadAd(request);
}
Comment
Answer by watercat · Feb 05, 2018 at 05:07 PM
set active truth or false this if he understands the qustions
Your answer
Follow this Question
Related Questions
Unity admob interstitial ads not showing. 0 Answers
Unity Admob not showing production ads [SOLVED] 1 Answer
Game crashes on player death 0 Answers
Admob shows only 1 SAME ad (ANDROID) 2 Answers