So I have have a script that plays an add every 90 seconds. Every time you change scene (which is quite regular) An ad pops up.
Does anyone know how to delay this
Script:
using UnityEngine;
using System.Collections;
using UnityEngine.Advertisements;
public class ShowAds : MonoBehaviour
{
float timer;
void Start()
{
Advertisement.Initialize (""); //REMEMBER TO EDIT!!
}
void Update()
{
timer -= Time.deltaTime;
ShowAd ();
}
public void ShowAd()
{
if (Advertisement.IsReady () && timer <= 0)
{
Advertisement.Show ();
timer = 90.0f;
}
}
}
↧