Quantcast
Channel: Questions in topic: "admob"
Viewing all articles
Browse latest Browse all 137

MonoBehaviours can only be added using AddComponent(). Alternatively.

$
0
0
Could I get some help to fix these 2 lines of my code? I know what the problem is but honestly don’t know how to fix it, Ive seen many examples but I don’t know how to apply it to MY code > using System; using UnityEngine; using GoogleMobileAds.Api; public class AdMob : MonoBehaviour { private BannerView bannerView; public void Start() { MobileAds.Initialize(initStatus => { }); this.RequestBanner(); } private void RequestBanner() { string adUnitId = "ca-app-pub-7396991836824042/1028963955"; this.bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Bottom); AdRequest request = new AdRequest.Builder().Build(); this.bannerView.LoadAd(request); } }

Viewing all articles
Browse latest Browse all 137

Trending Articles