当前位置:首页 > 开发 > 移动开发 > 正文

Unity JS 添加iAd

发表于: 2014-04-07   作者:G10A   来源:转载   浏览:
iAd
摘要: public var showOnTop:boolean = true; // banner on top or bottom of screen public var dontDestroy:boolean = false; // keep this GameObject around for next scene // don't make this a local variable,
public var showOnTop:boolean = true; // banner on top or bottom of screen
public var dontDestroy:boolean = false; // keep this GameObject around for next scene

// don't make this a local variable, or else it'll get garbage collected
private var banner:ADBannerView;

function Start () {
if (dontDestroy) {
GameObject.DontDestroyOnLoad(gameObject); // keep ad alive if we load a new scene
}
Debug.Log("Creating iAd banner");
banner = new ADBannerView(ADBannerView.Type.Banner,showOnTop ?
ADBannerView.Layout.Top : ADBannerView.Layout.Bottom);
ADBannerView.onBannerWasLoaded  += OnBannerLoaded;
}

function OnBannerLoaded() {
Debug.Log("Ad banner Loaded!\n");
banner.visible = true;
}
  From:http://www.fugutalk.com/?p=6387
官方C#:https://docs.unity3d.com/Documentation/ScriptReference/ADBannerView.html

Unity JS 添加iAd

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号