Advertisement
Guest User

Untitled

a guest
May 24th, 2015
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using UnityEngine.Advertisements; // Unity Ads を使うための宣言
  4.  
  5. public class UnityAdsSample : MonoBehaviour
  6. {
  7. public string gameID;
  8.  
  9. void Awake ()
  10. {
  11. if (Advertisement.isSupported) { // プラットフォームがサポートしているかどうか
  12. Advertisement.Initialize (gameID); // Unity Ads の初期化
  13. }
  14. }
  15.  
  16. public void ShowUnityAds ()
  17. {
  18. if (Advertisement.isReady ()) { // 準備ができていたら
  19. Advertisement.Show (); // 広告を表示
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement