using UnityEngine;
using System.Collections;
public class AdvertisementManager : MonoBehaviour {
void OnGUI()
{
// Make a background box
GUI.Box(new Rect(10, 10, 100, 90), "Loader Menu");
// Make the Enable Button
if (GUI.Button(new Rect(20, 40, 80, 20), "Enable"))
{
AdvertisementHandler.EnableAds();
}
// Make the Disable Button
if (GUI.Button(new Rect(20, 60, 80, 20), "Disable"))
{
AdvertisementHandler.DisableAds();
}
// Make the Hide Button
if (GUI.Button(new Rect(20, 80, 80, 20), "Hide"))
{
AdvertisementHandler.HideAds();
}
// Make the Show button.
if (GUI.Button(new Rect(20, 100, 80, 20), "Show"))
{
AdvertisementHandler.ShowAds();
}
}
// Use this for initialization
void Start () {
Debug.Log("Unity Calling Start");
AdvertisementHandler.Instantiate("a14e2fb60918999", AdvertisementHandler.AdvSize.BANNER, AdvertisementHandler.AdvOrientation.HORIZONTAL, AdvertisementHandler.Position.BOTTOM, AdvertisementHandler.Position.CENTER_HORIZONTAL, false, AdvertisementHandler.AnimationInType.SLIDE_IN_LEFT, AdvertisementHandler.AnimationOutType.FADE_OUT, AdvertisementHandler.LevelOfDebug.LOW);
AdvertisementHandler.EnableAds();
}
// Update is called once per frame
void Update () {
}
}
This is the code that he used to control the adverts. I'll ask on the unity forums too.
Thank you.