Esempio n. 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
        }
Esempio n. 2
0
        public void UnityAdsBannerClick(string placementId, BannerOptions bannerOptions)
        {
            var clickCallback = bannerOptions?.clickCallback;

            if (clickCallback != null)
            {
                UnityLifecycleManager?.Post(() => {
                    bannerOptions.clickCallback();
                });
            }
        }
Esempio n. 3
0
        public void UnityAdsBannerDidHide(string placementId, BannerOptions bannerOptions)
        {
            var hideCallback = bannerOptions?.hideCallback;

            if (hideCallback != null)
            {
                UnityLifecycleManager?.Post(() => {
                    bannerOptions.hideCallback();
                });
            }
        }
Esempio n. 4
0
        public void UnityAdsBannerDidShow(string placementId, BannerOptions bannerOptions)
        {
            var showCallback = bannerOptions?.showCallback;

            if (showCallback != null)
            {
                UnityLifecycleManager?.Post(() => {
                    bannerOptions.showCallback();
                });
            }
        }
Esempio n. 5
0
 /// <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();
 }
Esempio n. 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);
            }
Esempio n. 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);
 }
Esempio n. 8
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)
 {
     s_Platform.Banner.Show(string.IsNullOrEmpty(placementId) ? null : placementId, options);
 }
Esempio n. 9
0
 public void Show(string placementId, BannerOptions showOptions)
 {
 }
Esempio n. 10
0
 public void Show(string placementId, BannerOptions showOptions)
 {
     m_NativeBanner.Show(placementId, showOptions);
 }