Quantcast
Channel: Questions in topic: "ads"
Viewing all articles
Browse latest Browse all 1416

Displaying Admob's banner ad in game scene

$
0
0
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

Viewing all articles
Browse latest Browse all 1416

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>