バナー広告の導入

対応OS

  • Android 4.4 以上
  • iOS 10.0 以上

広告の設置

実装例

  1. HierarchyからMain Camera等を選択しInspector->Add Component->Scriptをクリックします。
  2. Adstir Pluginを選択して、追加します。
  3. Plugins/AdstirPlugin.csのOnEnableとOnDisableをアンコメントします。
  4. MEDIA-IDおよびSPOT-IDは管理画面で取得したメディアID枠Noに置換してください。
public void OnEnable()
{
    this.ShowAd("MEDIA-ID",SPOT-ID,0,0,320,50);
}

public void OnDisable()
{
    this.HideAd();
}

座標による指定

下記いずれかのメソッドを使用して指定することができます。

X, Y座標を指定

this.ShowAd(string media, int spot, int x, int y, int w, int h);

Layout列挙型で指定

this.ShowAd(string media, int spot, int w, int h, Layout layout);

Layout列挙型は以下のいずれかを使用できます。

縦位置 横位置
Top 中央
TopLeft
TopRight
Center 中央
CenterLeft 中央
CenterRight 中央
Bottom
BottomLeft
BottomRight

対応している広告サイズ

  • 320x50
  • 320x100
  • 300x250