I have two scenes. Menu and Game. I want a banner ad to always stay on screen only and only during the game scene. How can I do this?
This is the ad script
public class AdManager : MonoBehaviour {
public static AdManager Instance{ set; get; }
public string bannerId;
public string videoId;
// Use this for initialization
private void Start () {
Instance = this;
DontDestroyOnLoad (gameObject);
#if UNITY_EDITOR
#elif UNITY_ANDROID
Admob.Instance().setTesting(true);
Admob.Instance ().initAdmob (bannerId, videoId);
#endif
}
// Update is called once per frame
void Update () {
}
public void ShowBanner(){
#if UNITY_EDITOR
#elif UNITY_ANDROID
Admob.Instance ().showBannerRelative (AdSize.Banner, AdPosition.TOP_CENTER, 0);
#endif
}
}
To show the banner I am using : AdManager.Instance.ShowBanner ();
Thank You
↧