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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Loading an ad but not showing it

Discussion in 'Scripting' started by Barft, Aug 14, 2015.

  1. Barft

    Barft

    Joined:
    Apr 9, 2015
    Posts:
    84
    Hi all, I have a problem, I want to load an advertisment from admob but not showing it, I want to do this because it takes 5 seconds to load for the first time an advertisment. So it will load the other ads faster.

    I'm a little beginner to all c# and ads, so maybe somebody can help me with this problem

    Thanks!
     
  2. Not_Sure

    Not_Sure

    Joined:
    Dec 13, 2011
    Posts:
    3,541
    You load the ad when you initialize it then show it when you'r ready.

    So, you can put something like:
    Code (csharp):
    1.  
    2.  
    3. void Start(){
    4. Advertisement.Initialize ("Your game ID", true /* Denotes if it is in test mode or not */);
    5. }
    6.  
    7. void ShowAd(){
    8. Advertisement.Show();
    9. }
    10.  
    This video will help:

     
  3. Barft

    Barft

    Joined:
    Apr 9, 2015
    Posts:
    84
    Thanks for your reaction, but is it possible to change the position of the ad?
     
  4. Not_Sure

    Not_Sure

    Joined:
    Dec 13, 2011
    Posts:
    3,541
    Sorry, I don't know.
     
  5. Barft

    Barft

    Joined:
    Apr 9, 2015
    Posts:
    84
    o ok,