Exemplo n.º 1
0
 /// <summary>
 /// Loads the banner ad with a specified <a href="../manual/MonetizationPlacements.html">Placement</a>, but fires the <c>loadCallback</c> callback on successful load, and the <c>errorCallback</c> callback on failure to load.
 /// </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 loading the banner.</param>
 public static void Load(string placementId, BannerLoadOptions options)
 {
     if (options != null)
     {
         if (options.loadCallback != null)
         {
             EventHandler <EventArgs> handler = null;
             handler = (object sender, EventArgs args) =>
             {
                 s_Platform.Banner.OnLoad -= handler;
                 options.loadCallback();
             };
             s_Platform.Banner.OnLoad += handler;
         }
         if (options.errorCallback != null)
         {
             EventHandler <ErrorEventArgs> handler = null;
             handler = (object sender, ErrorEventArgs args) =>
             {
                 s_Platform.Banner.OnError -= handler;
                 options.errorCallback(args.message);
             };
             s_Platform.Banner.OnError += handler;
         }
     }
     s_Platform.Banner.Load(placementId);
 }
Exemplo n.º 2
0
        public void UnityAdsBannerDidError(string message, BannerLoadOptions bannerOptions)
        {
            var errorCallback = bannerOptions?.errorCallback;

            if (errorCallback != null)
            {
                UnityLifecycleManager?.Post(() => {
                    bannerOptions.errorCallback(message ?? "");
                });
            }
        }
Exemplo n.º 3
0
        public void UnityAdsBannerDidLoad(string placementId, BannerLoadOptions bannerOptions)
        {
            var loadCallback = bannerOptions?.loadCallback;

            if (loadCallback != null)
            {
                UnityLifecycleManager?.Post(() => {
                    bannerOptions.loadCallback();
                });
            }
        }
Exemplo n.º 4
0
 public void ShowBanner()
 {
     if (bannerShown)
     {
         UnityEngine.Advertisements.Advertisement.Banner.Hide(true);
     }
     else
     {
         UnityEngine.Advertisements.BannerLoadOptions options = new UnityEngine.Advertisements.BannerLoadOptions();
         options.loadCallback  = BannerLoadCallback;
         options.errorCallback = BannerErrorCallback;
         UnityEngine.Advertisements.Advertisement.Banner.Load(bannerPlacementID, options);
     }
 }
Exemplo n.º 5
0
        public void Load(string id, Action <SA_Result> callback)
        {
#if SA_UNITY_ADS_INSTALLED
            m_advertisementId = id;
            if (UADS.Advertisement.IsReady(id))
            {
                callback.Invoke(new SA_Result());
                return;
            }

            m_loadCallback = callback;
            UADS.BannerLoadOptions loadOptions = new UADS.BannerLoadOptions();
            loadOptions.errorCallback += LoadErrorCallback;
            loadOptions.loadCallback  += LoadCallback;
            UADS.Advertisement.Banner.Load(id, loadOptions);
#endif
        }
Exemplo n.º 6
0
 /// <summary>
 /// Loads the banner ad with the default <a href="../manual/MonetizationPlacements.html">Placement</a>, but fires the <c>loadCallback</c> callback on successful load, and the <c>errorCallback</c> callback on failure to load.
 /// </summary>
 /// <param name="options">A collection of options that notify the SDK of events when loading the banner.</param>
 public static void Load(BannerLoadOptions options)
 {
     Load(null, options);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Loads the banner ad with a specified <a href="../manual/MonetizationPlacements.html">Placement</a>, but fires the <c>loadCallback</c> callback on successful load, and the <c>errorCallback</c> callback on failure to load.
 /// </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 loading the banner.</param>
 public static void Load(string placementId, BannerLoadOptions options)
 {
     s_Platform.Banner.Load(placementId, options);
 }
Exemplo n.º 8
0
 public void Load(string placementId, BannerLoadOptions loadOptions)
 {
 }
Exemplo n.º 9
0
 public void Load(string placementId, BannerLoadOptions loadOptions)
 {
     m_NativeBanner.Load(placementId, loadOptions);
 }
Exemplo n.º 10
0
 /// <summary>
 /// Loads 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 Load(string placementId, BannerLoadOptions loadOptions)
 {
     loaded = true;
     currentBannerPosition = bannerPosition;
     loadOptions?.loadCallback();
 }