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

Timer between ads displayed

$
0
0
Im using google admob and to make my users happy and not fed up with ads i want to space them out. I have a working code which i know works as in the console it says a message whenever one is supposed to display. Here is my code and i want to see how to add a 240 second timer between ads shown. Please help :). using System.Collections; using System.Collections.Generic; using UnityEngine; using GoogleMobileAds.Api; public class AdmobManager : MonoBehaviour { private BannerView bannerView; [SerializeField] private string appID = ""; [SerializeField] private string bannerID = ""; [SerializeField] private string regularAD = ""; private void Awake() { MobileAds.Initialize(appID); } public void OnclickShowBanner() { this.RequestBanner(); } public void OnClickShowAd() { this.RequestRegularAd(); } private void RequestRegularAd() { InterstitialAd AD = new InterstitialAd(regularAD); AdRequest request = new AdRequest.Builder().Build(); AD.LoadAd(request); } private void RequestBanner() { bannerView = new BannerView(bannerID, AdSize.Banner, AdPosition.Bottom); AdRequest request = new AdRequest.Builder().Build(); bannerView.LoadAd(request); } }

Viewing all articles
Browse latest Browse all 1416

Trending Articles