Created
April 13, 2015 22:33
-
-
Save yasuyuki-kamata/5ecefe82dfc766bc0551 to your computer and use it in GitHub Desktop.
[Unity Ads]動画広告の表示 基本的なコーディング
This file contains 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; | |
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 (); // 広告を表示 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment