Question by
WitherSS_Studio · Jan 11, 2018 at 06:56 PM ·
c#unity 5visual studioadmobunityads
How to display ads every 5 mins ?
I am using ADmob ads, here is my script:
public static AdManager Instance{set;get;}
public string bannerId;
public string videoId;
private void Start()
{
Instance = this;
DontDestroyOnLoad (gameObject);
#if UNITY_EDITOR
#elif UNITY_ANDROID
Admob.Instance ().initAdmob (bannerId,videoId);
Admob.Instance ().loadInterstitial ();
#endif
}
public void ShowBanner()
{
#if UNITY_EDITOR
Debug.Log("Unable to play banner ads from EDITOR");
#elif UNITY_ANDROID
Admob.Instance().showBannerRelative (AdSize.Banner, AdPosition.BOTTOM_CENTER, 5);
#endif
}
public void ShowVideo()
{
#if UNITY_EDITOR
Debug.Log("Unable to play ads from EDITOR");
#elif UNITY_ANDROID
if (Admob.Instance ().isInterstitialReady ())
{
Admob.Instance ().showInterstitial ();
}
#endif
}
Comment