- Home /
 
 
               Question by 
               ekimjune23 · Aug 13, 2015 at 09:05 AM · 
                c#android  
              
 
              Unity Ads currently playing ads repeatedly, how to fix?
Hi,
I'm looking for help getting Unity Ads to play one ad when my game (Android app) starts, then stop playing ads.
Right now the ads constantly play, one after the other. Getting the ads to work was a small victory, but it makes the game unplayable. I'm new to programming, and everything I've tried adding to my script has not worked.
Is there something I can add that will check if an ad was played, and not play another if it's true?
Here's the code:
 using UnityEngine;
 using System.Collections;
 using UnityEngine.Advertisements;
  
 public class SimpleAds : MonoBehaviour
 {
     void Start ()
     {
         Advertisement.Initialize ("11111");
  
         StartCoroutine (ShowAdWhenReady());
     }
  
     IEnumerator ShowAdWhenReady()
     {
         while (!Advertisement.IsReady ())
             yield return null;
  
         Advertisement.Show ();
     }
 
              
               Comment
              
 
               
              Your answer
 
             Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Character Movement Problem 0 Answers
Why does my pause & quit menus appear when I load next level? 0 Answers