Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEngine.Advertisements;
- using System.Collections;
- public class SimpleAdScript : MonoBehaviour
- {
- void ShowUnityAd()
- {
- #if UNITY_ANDROID
- Advertisement.Initialize ("IDANDROID", true);
- #elif UNITY_IPHONE
- Advertisement.Initialize ("IDIOS", true);
- #endif
- StartCoroutine (ShowAdWhenReady ());
- }
- IEnumerator ShowAdWhenReady()
- {
- while (!Advertisement.isReady ())
- yield return null;
- Advertisement.Show ();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement