You shouldnt use Advertisement.Show(); with Update function.
Advertisement.isReady() method is “true” as soon as Advertisement is Ready. An your if statement is always true. You are trying to show your ad in every frame.
Yes you should remove Advertisement.Show(); from your Update method, or dont use directly in update method.
Lets go with your script;
using UnityEngine.Advertisements;
using UnityEngine;
using System.Collections;
public class Ad2 : MonoBehaviour {
// Use this for initialization
void Start () {Advertisement.Initialize ("ID#");
}
// Update is called once per frame
void Update ()
{
if (Input.GetKey ("escape"))
{
if(Advertisement.isReady())
{
Advertisement.Show();
}
}
}
}
I copied the code and saved it as .cs press esc key and the ad spot (Blue box) shows.
I sent through xcode to my ipad it looks like it’s trying to do something but does not show?
Maybe the ads are not currently being served?
Change Input.GetKey(“escape”) with Input.anyKeyDown it may solve your problem for now, I dont know what is mapped for escape in ipad.
I am not a professional developer, I am just trying to show an example. You should search for good practices for using Unity3d it self.
I recommend you to dive into Unity.com and follow learning paths…
I downloaded the demo it won’t play I get a compiler errors message.
Wouldn’t it just be easier to post a complete working script on the getting started page?
Assets/DemoApp/Scripts/level/LevelSceneController.cs(3,19): error CS0234: The type or namespace name Advertisements' does not exist in the namespace UnityEngine’. Are you missing an assembly reference?
I think it’s coz of Advertisement.Show() is called whenever Advertisement.isReady() = true so you need to call Advertisement.Show() when a button is pressed or some action is done like when game over , player leaving etc …
it accuse the following error:
The type or namespace name Advertisements' does not exist in the namespace UnityEngine’. Are you missing an assembly reference
Sounds like a unity ads package installation problem. Could you please, try to remove all unity ads folders from your asset folder and re install the latest unity-ads package from asset store.Please let us know if it changes anything.