Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using UnityEngine.Advertisements; // Unity Ads を使うための宣言
- public class UnityAdsSample : MonoBehaviour
- {
- public string gameID;
- void Awake ()
- {
- if (Advertisement.isSupported) { // プラットフォームがサポートしているかどうか
- Advertisement.Initialize (gameID); // Unity Ads の初期化
- }
- }
- public void ShowUnityAds ()
- {
- if (Advertisement.isReady ()) { // 準備ができていたら
- Advertisement.Show (); // 広告を表示
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement