Skip to content

Instantly share code, notes, and snippets.

@is8r
Last active August 29, 2015 14:03
Show Gist options
  • Select an option

  • Save is8r/c3e0def109bfa37f904d to your computer and use it in GitHub Desktop.

Select an option

Save is8r/c3e0def109bfa37f904d to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
public class Ad : MonoBehaviour {
private ADBannerView banner = null;
private bool isBannerLoaded = false;
void Start () {
#if UNITY_IPHONE
//DontDestroyOnLoad(transform.gameObject);
banner = new ADBannerView(ADBannerView.Type.Banner, ADBannerView.Layout.Bottom);
#endif
}
void Update () {
#if UNITY_IPHONE
if(!isBannerLoaded && banner.visible && banner == null && !banner.loaded){
banner.visible = false;
} else {
isBannerLoaded = true;
if(banner != null) {
banner.visible = true;
}
}
#endif
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment