Question by
WitherSS_Studio · Jan 11, 2018 at 03:10 PM ·
unity 5unityeditorunityads
How to display Admob ads in Unity every 5-10 mins?
I want to Admob Interstitial ads shows up every 5 mins, how to do that, my script looks like this:
using System.Collections; using System.Collections.Generic; using UnityEngine; using admob;
public class AdManager : MonoBehaviour {
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
Your answer
![](https://koobas.hobune.stream/wayback/20220612150303im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to display ad after some time? 0 Answers
How to display ads every 5 mins ? 1 Answer
How to load level after typing somthing? 1 Answer
Running shell scripts Mac: POST BUILD -1 Answers