Exemplo n.º 1
0
 private void onClickHideBanner()
 {
     if (AdmobManager.IsBannerLoaded())
     {
         AdmobManager.HideBanner();
     }
 }
Exemplo n.º 2
0
    public void ToggleBaner()
    {
        banner = !banner;

        if (banner)
        {
            AdmobManager.ShowBanner();
            bannerButtonImage.color = Color.green;
        }
        else
        {
            AdmobManager.HideBanner();
            bannerButtonImage.color = Color.white;
        }
    }
Exemplo n.º 3
0
    void DrawBannerAdvs()
    {
        m_rect.x = 20;
        m_rect.y = 50;

        m_rect.width  = Screen.width * 0.2f;
        m_rect.height = Screen.height * 0.12f;

        if (GUI.Button(m_rect, "Create Banner"))
        {
            //AdmobManager.CreateBannerAd("Banner_1");  //Simple, with default options
            //OR
            BannerAd l_bannerAd = AdmobManager.Prepare <BannerAd>("Banner_1");
            l_bannerAd.BannerType  = EBannerAdType.SMART_BANNER;
            l_bannerAd.Orientation = EOrientation.HORIZONTAL;
            l_bannerAd.AnimInType  = EAnimationInType.FADE_IN;
            l_bannerAd.AnimOutType = EAnimationOutType.SLIDE_OUT_RIGHT;
            l_bannerAd.SetPosition(EPosition.CENTER_HORIZONTAL, EPosition.BOTTOM);

            //Admob Callbacks
            l_bannerAd.OnAdLoaded += MyCustom_OnAdLoadedEvent;

            l_bannerAd.Create();
        }

        m_rect.y = m_rect.y + m_rect.height;
        if (GUI.Button(m_rect, "Load Banner"))
        {
            AdmobManager.Load("Banner_1");
            //OR
            //BannerAd l_bannerAd = AdmobManager.Get<BannerAd>("Banner_1");
            //l_bannerAd.Load();
        }

        m_rect.y = m_rect.y + m_rect.height;

        if (GUI.Button(m_rect, "Show Adv"))
        {
            AdmobManager.ShowBanner("Banner_1");
            //OR
            //BannerAd l_bannerAd = AdmobManager.Get<BannerAd>("Banner_1");
            //l_bannerAd.Show();
        }

        m_rect.y = m_rect.y + m_rect.height;

        if (GUI.Button(m_rect, "Hide Adv"))
        {
            AdmobManager.HideBanner("Banner_1");
            //OR
            //BannerAd l_bannerAd = AdmobManager.Get<BannerAd>("Banner_1");
            //l_bannerAd.Hide();
        }

        m_rect.y = m_rect.y + m_rect.height;

        if (GUI.Button(m_rect, "Remove Immediately"))
        {
            AdmobManager.RemoveAdImmediately("Banner_1");
        }

        m_rect.y = m_rect.y + m_rect.height;

        if (GUI.Button(m_rect, "Reposition"))
        {
            BannerAd l_bannerAd = AdmobManager.Get <BannerAd>("Banner_1");
            l_bannerAd.Reposition(EPosition.TOP, EPosition.CENTER_HORIZONTAL);
        }

        m_rect.y = m_rect.y + m_rect.height;

        if (GUI.Button(m_rect, "Create with New AdUnitID"))
        {
            BannerAd l_newBanner = AdmobManager.Prepare <BannerAd>("banner_with_diff_unit_id");
            l_newBanner.AdUnitId = "ca-app-pub-4192487455949741/8385716917";
            l_newBanner.SetPosition(EPosition.CENTER_HORIZONTAL, EPosition.TOP);
            l_newBanner.Create();
            l_newBanner.Load();
        }
    }
Exemplo n.º 4
0
 public void HideBanner()
 {
     Admob.HideBanner();
 }