Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unity ads working nice in the editor but I can't see them on my phone

Discussion in 'Unity Ads & User Acquisition' started by GabeGabe, Feb 4, 2015.

  1. GabeGabe

    GabeGabe

    Joined:
    Jan 4, 2015
    Posts:
    38
    Hi!

    So I integrated Unity ads and when I test it its cool and working. (Because that little box with the close button appears)

    But when I use my game on my phone then When it reaches the 3 deaths then it doesn't show ads.

    Why?

    I've got a game object called "GameController". This is in the start method:
    Code (CSharp):
    1. if (Advertisement.isSupported) {
    2.             Advertisement.allowPrecache = true;
    3.             Advertisement.Initialize("MYCODE");
    4.         }
    And then I've got this in the Update() method:

    Code (CSharp):
    1. if (TapSpawnerRandom.dieCounter == 3 && Advertisement.isReady()) {
    2.             if (!Advertisement.isShowing) {
    3.                 Advertisement.Show(null, new ShowOptions {
    4.                     pause = true,
    5.                     resultCallback = result => {
    6.                     }
    7.                 });
    8.  
    9.             }
    10.             TapSpawnerRandom.dieCounter = 0;
    11.         }
    Is there anything I do wrong?
     
  2. GabeGabe

    GabeGabe

    Joined:
    Jan 4, 2015
    Posts:
    38
    And on the UnityAds page I created a new game and I just used that ID what I can see there.
     
  3. unity-nikkolai

    unity-nikkolai

    Unity Technologies

    Joined:
    Sep 18, 2014
    Posts:
    540
    You should set your condition as dieCounter >= 3, that way if isReady == false it'll try again the next time.
     
  4. GabeGabe

    GabeGabe

    Joined:
    Jan 4, 2015
    Posts:
    38
    Thanks!