Question by
The-Evster · Oct 23, 2016 at 07:20 PM ·
scripting problembuttonunity adshealth
Unity Ads Not Working (Not Displaying Ad)
I have a Ad Display script that will show a ad that you cant skip. It is set up so that the ad will be shown if a button is pressed but i doesn't seem to be working
using UnityEngine;
using UnityEngine.Advertisements;
using System.Collections;
public class Ad_Display : MonoBehaviour {
[SerializeField] string gameID = "1177323";
void Awake ()
{
Advertisement.Initialize(gameID, true);
}
public void ShowAdd()
{
if (Advertisement.IsReady("rewardedVideoZone"))
{
ShowOptions options = new ShowOptions();
options.resultCallback = HandleShowResult;
Advertisement.Show("rewardedVideoZone", options);
Debug.Log("Add has been Showen");
}
}
private void HandleShowResult(ShowResult result)
{
switch (result)
{
case ShowResult.Finished:
Debug.Log("The ad was successfully shown.");
break;
case ShowResult.Skipped:
Debug.Log("The ad was skipped before reaching the end.");
break;
case ShowResult.Failed:
Debug.LogError("The ad failed to be shown.");
break;
}
}
}
Any help will be greatly appreciated.
Comment
Your answer
Follow this Question
Related Questions
(Unity Ads) The referenced script on this Behaviour (Game Object 'Button') is missing! 0 Answers
Button Sprite Stretching 0 Answers
button.interactable = false; not working ,Button.interectable = false; doesnt work 0 Answers
Make button move character? 1 Answer
How do I script a cursor to scroll, and select a button with keys 1 Answer