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

Adjusting banner ad size

$
0
0
I have successfully implemented ads, but I cannot manage to find anything about setting the size of banners. My current code that I have used and successfully tried is: public class BannerAdScript : MonoBehaviour { public string gameId = "1234567"; public string placementId = "bannerPlacement"; public bool testMode = true; [SerializeField] BannerPosition _bannerPosition = BannerPosition.BOTTOM_CENTER; void Start() { // Initialize the SDK if you haven't already done so: Advertisement.Initialize(gameId, testMode); StartCoroutine(ShowBannerWhenReady()); // Set the banner position: Advertisement.Banner.SetPosition(_bannerPosition); } IEnumerator ShowBannerWhenReady() { while (!Advertisement.IsReady(placementId)) { yield return new WaitForSeconds(0.5f); } Advertisement.Banner.Show(placementId); } } How do I set the height in a banner ad?

Viewing all articles
Browse latest Browse all 1416

Trending Articles



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