- Home /
Question by
subash95 · Apr 14, 2015 at 10:11 PM ·
unityeditorads
How do unity ads need to be shown in editor?
I have a restart button and a main menu button. When the user clicks(taps) any of the buttons my ads should show up. So, I made a adscript to call a restart script. But it didn't work. Please help. my adscript:
using UnityEngine;
using System.Collections;
using UnityEngine.Advertisements;
public class adscript : MonoBehaviour {
public restart res;
// Use this for initialization
void Start () {
Advertisement.Initialize ("*****");
}
// Update is called once per frame
void Update () {
}
public void click()
{
if (Advertisement.isReady ()) {
Advertisement.Show ();
Debug.Log ("adshown");
}
else {
res.cal ();
}
res.cal ();
}
}
Comment
Your answer
Follow this Question
Related Questions
I want to enable Unity Ads Plancements, but "Page Not Found" 0 Answers
Unity Mediation Plug-In breaks the game with infinite Resolving Android Dependencies 0 Answers
Why is my admob banner ad not showing ?? 2 Answers
ptr == NULL || GET_CURRENT_ALLOC_ROOT_HEADER() ... 1 Answer
unity ads works fine in the editor but not in android device 0 Answers