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 ();
}
}
↧