不解

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

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

 

                                                                     于飞  翻译 unity

ADBannerView is a 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 a 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 a user-triggered action? (Read Only)

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

error

错误

An advertisement error. (Read Only)

广告报错(只读型)

                                                                     于飞  翻译 unity

 

Constructors构造函数

ADBannerView

广告横幅视图(广告窗)

Creates a 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 a banner content size identifier into its physical size.

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

评论