コード例 #1
0
        public void Show(Action callback)
        {
#if SA_UNITY_ADS_INSTALLED
            m_showCallback = callback;
            UADS.BannerOptions showOptions = new UADS.BannerOptions();
            showOptions.showCallback += ShowCallback;

            UADS.Advertisement.Banner.Show(m_advertisementId, showOptions);
#endif
        }
コード例 #2
0
ファイル: Banner.cs プロジェクト: Alperen10/FoodEaterGame
        public void UnityAdsBannerClick(string placementId, BannerOptions bannerOptions)
        {
            var clickCallback = bannerOptions?.clickCallback;

            if (clickCallback != null)
            {
                UnityLifecycleManager?.Post(() => {
                    bannerOptions.clickCallback();
                });
            }
        }
コード例 #3
0
ファイル: Banner.cs プロジェクト: Alperen10/FoodEaterGame
        public void UnityAdsBannerDidHide(string placementId, BannerOptions bannerOptions)
        {
            var hideCallback = bannerOptions?.hideCallback;

            if (hideCallback != null)
            {
                UnityLifecycleManager?.Post(() => {
                    bannerOptions.hideCallback();
                });
            }
        }
コード例 #4
0
ファイル: Banner.cs プロジェクト: Alperen10/FoodEaterGame
        public void UnityAdsBannerDidShow(string placementId, BannerOptions bannerOptions)
        {
            var showCallback = bannerOptions?.showCallback;

            if (showCallback != null)
            {
                UnityLifecycleManager?.Post(() => {
                    bannerOptions.showCallback();
                });
            }
        }
コード例 #5
0
ファイル: Banner.cs プロジェクト: Ruipcc1/Morse-Code
 /// <summary>
 /// Displays the banner ad with a specified <a href="../manual/MonetizationPlacements.html">Placement</a>, and no callbacks.
 /// </summary>
 /// <param name="placementId">The unique identifier for a specific Placement, found on the <a href="https://operate.dashboard.unity3d.com/">developer dashboard</a>.</param>
 public void Show(string placementId, BannerOptions showOptions)
 {
     m_ShowOptions = showOptions;
     if (!loaded)
     {
         Load(placementId, null);
     }
     m_placementId = placementId;
     m_showing     = true;
     showOptions?.showCallback();
 }
コード例 #6
0
            /// <summary>
            /// Displays the banner ad with a specified <a href="../manual/MonetizationPlacements.html">Placement</a>, but fires the <c>showCallback</c> callback if the banner is visible, and the <c>hideCallback</c> if it isn't.
            /// </summary>
            /// <param name="placementId">The unique identifier for a specific Placement, found on the <a href="https://operate.dashboard.unity3d.com/">developer dashboard</a>.</param>
            /// <param name="options">A collection of options that notify the SDK of events when displaying the banner.</param>
            public static void Show(string placementId, BannerOptions options)
            {
                if (s_UnloadHandler == null)
                {
                    s_UnloadHandler = (object sender, EventArgs args) =>
                    {
                        if (s_StartHandler != null)
                        {
                            s_Platform.Banner.OnShow -= s_StartHandler;
                            s_StartHandler            = null;
                        }
                        if (s_HideHandler != null)
                        {
                            s_Platform.Banner.OnHide -= s_HideHandler;
                            s_HideHandler             = null;
                        }
                        s_Platform.Banner.OnUnload -= s_UnloadHandler;
                    };
                    s_Platform.Banner.OnUnload += s_UnloadHandler;
                }

                if (options != null)
                {
                    if (options.showCallback != null && s_StartHandler == null)
                    {
                        s_StartHandler = (object sender, StartEventArgs args) =>
                        {
                            options.showCallback();
                        };
                        s_Platform.Banner.OnShow += s_StartHandler;
                    }
                    if (options.hideCallback != null && s_HideHandler == null)
                    {
                        s_HideHandler = (object sender, HideEventArgs args) =>
                        {
                            options.hideCallback();
                        };
                        s_Platform.Banner.OnHide += s_HideHandler;
                    }
                }

                s_Platform.Banner.Show(string.IsNullOrEmpty(placementId) ? null : placementId);
            }
コード例 #7
0
 /// <summary>
 /// Displays the banner ad with the default <a href="../manual/MonetizationPlacements.html">Placement</a>, but fires the <c>showCallback</c> callback if the banner is visible, and the <c>hideCallback</c> if it isn't.
 /// </summary>
 /// <param name="options">A collection of options that notify the SDK of events when displaying the banner.</param>
 public static void Show(BannerOptions options)
 {
     Show(null, options);
 }
コード例 #8
0
ファイル: Advertisement.cs プロジェクト: Cobecc/ClickerCat
 /// <summary>
 /// Displays the banner ad with a specified <a href="../manual/MonetizationPlacements.html">Placement</a>, but fires the <c>showCallback</c> callback if the banner is visible, and the <c>hideCallback</c> if it isn't.
 /// </summary>
 /// <param name="placementId">The unique identifier for a specific Placement, found on the <a href="https://operate.dashboard.unity3d.com/">developer dashboard</a>.</param>
 /// <param name="options">A collection of options that notify the SDK of events when displaying the banner.</param>
 public static void Show(string placementId, BannerOptions options)
 {
     s_Platform.Banner.Show(string.IsNullOrEmpty(placementId) ? null : placementId, options);
 }
コード例 #9
0
 public void Show(string placementId, BannerOptions showOptions)
 {
 }
コード例 #10
0
ファイル: Banner.cs プロジェクト: Alperen10/FoodEaterGame
 public void Show(string placementId, BannerOptions showOptions)
 {
     m_NativeBanner.Show(placementId, showOptions);
 }