Last active
August 29, 2015 14:03
-
-
Save is8r/c3e0def109bfa37f904d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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