分享

UnityADBannerView广告横幅视图(广告窗)于飞

 3dC 2014-08-06

今天开始Unity 脚本手册中的Runtime Classes (运行类)

这一部分我会继续为大家提供Unity的脚本手册的中文翻译(纯属个人行为,没有商业目的,原版翻译,版权所有,转载切记!)和我自己在学习Unity过程中自己的见解,希望用我自己的力量抵制网络上的“业余翻译”,人间正道是沧桑。

ADBannerView广告横幅视图(广告窗)

 

                                                                     于飞  翻译 unity

ADBannerView is wrapper around the ADBannerView class found in the Apple iAd framework and is only available on iPhone/iPad/iPod Touch.

ADBannerView是一个在Apple iAd框架中发现的 ADBannerView类的包装并且仅仅只能用于iPhone/iPad/iPod Touch

 

                                                                     于飞  翻译 unity

It provides view that displays banner advertisements to the user.

它向用户提供了一个展示横幅广告的试图(广告位)

 

private var banner ADBannerView null;
   
function ShowBanner() {

       //当广告位没有上载,并且出现错误,就无法显示(显示为空)
    while (!banner.loaded && banner.error == null)
        yield;
     //错误为空,则正常显示;否则显示为空

    if (banner.error == null)
        banner.Show();

    else banner null;
}

function OnGUI() {

//GUI:用户图形界面

//使用GUI组件

//如果banner判断为空,GUI.enabled值为“true”,GUI被激活(三元运算符)

//如果banner判断为“非空”,GUI.enabled值为“false”,GUI不被激活
    GUI.enabled (banner == null true false);
   

//定义"Show Banner"按键

//定义广告位
    if (GUILayout.Button("Show Banner")) {
        banner new ADBannerView();
        banner.autoSize true;
        banner.autoPosition ADPosition.Bottom;
        StartCoroutine(ShowBanner());
    }
}

                                                                     于飞  翻译 unity

 

 

Variables变量

requiredSizeIdentifiers

必要的尺寸标识符(用于识别变量的标识符)

Identifiers for the sizes of advertisements that the banner view can display.

广告横幅视图可显示的尺寸(大小)标识符

currentSizeIdentifier

当前尺寸标识符

The current size of the advertisement displayed in the banner view.

显示在广告横幅视图内广告的当前尺寸

autoSize

自动尺寸(大小)

If enabled, current banner's size is set automatically according to current screen orientation. It is disabled by default.

如果是可行的(被激活),当前横幅的尺寸的尺寸会根据屏幕自动适应。(该功能)在默认情况下(缺省设置)是被禁止的

position

位置

The position of the banner view.

横幅视图的位置

autoPosition

自动位置

Enables the banner view to be positioned automatically.

允许将横幅视图自动定位

visible

可见

Is the banner view visible? (Read Only)

横幅视图是否可见(只读型)

loaded

下载(已完成的下载)

Has the banner view downloaded an advertisement? (Read Only)

广告横幅视图是否下载广告?(只读型)

actionInProgress

进程中的行为

Is the banner currently executing user-triggered action? (Read Only)

横幅当前正在执行用户的触发动作么?(只读型)

error

错误

An advertisement error. (Read Only)

广告报错(只读型)

                                                                     于飞  翻译 unity

 

Constructors构造函数

ADBannerView

广告横幅视图(广告窗)

Creates banner view.

创建横幅视图

                                                                     于飞  翻译 unity

 

Functions函数(方法/功能

Show

显示

Shows the banner view.

显示横幅视图

Hide

隐藏

Hides the banner view.

隐藏横幅视图

CancelAction

取消操作

Cancels an executing banner view action.

取消执行横幅视图操作

 

Class Functions类函数(类方法)

GetSizeFromSizeIdentifier

获取尺寸标识符的尺寸

Converts banner content size identifier into its physical size.

将横幅内的尺寸标识符转换为物理尺寸

 

 

 

                                                                     于飞  翻译 unity



 

                                         于飞 翻译 unity脚本手册

于飞新浪微博

Unity <wbr><wbr>Overview: <wbr><wbr>Coroutines <wbr><wbr>& <wbr><wbr>Yield <wbr><wbr> <wbr><wbr>概览:协同程序&中断&nb
于飞 unity3d微信公共平台
Unity <wbr><wbr>Overview: <wbr><wbr>Coroutines <wbr><wbr>& <wbr><wbr>Yield <wbr><wbr> <wbr><wbr>概览:协同程序&中断&nb 于飞网易 http://m18945656221.blog.163.com/


于飞新浪 http://blog.sina.com.cn/runyixiansheng


 


    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多