예제 #1
0
        public override void Show(string zoneId, string adapterId)
        {
            Dictionary <string, object> configuration = _configurations[zoneId + adapterId];

            if (configuration != null && configuration.ContainsKey("network"))
            {
                UnityAds.setNetwork((string)configuration["network"]);
            }
            string videoZoneId = null;
            string rewardItem  = "";

            if (configuration != null && configuration.ContainsKey("zone"))
            {
                videoZoneId = (string)configuration["zone"];
            }
            if (configuration != null && configuration.ContainsKey("rewardItem"))
            {
                rewardItem = (string)configuration["rewardItem"];
            }

            UnityAds.OnShow           += UnityAdsShow;
            UnityAds.OnHide           += UnityAdsHide;
            UnityAds.OnVideoCompleted += UnityAdsVideoCompleted;
            UnityAds.OnVideoStarted   += UnityAdsVideoStarted;

            UnityAds.show(videoZoneId, rewardItem);
        }
예제 #2
0
        public override void Show(string zoneId, string adapterId, ShowOptions options = null)
        {
            if (options != null && options.pause == false)
            {
                Utils.LogWarning("Video ads will always pause engine, ignoring pause=false in ShowOptions");
            }

            Dictionary <string, object> configuration = _configurations[zoneId + adapterId];

            if (configuration != null && configuration.ContainsKey("network"))
            {
                UnityAds.setNetwork((string)configuration["network"]);
            }
            string videoZoneId = null;
            string rewardItem  = "";

            if (configuration != null && configuration.ContainsKey("zone"))
            {
                videoZoneId = (string)configuration["zone"];
            }
            if (configuration != null && configuration.ContainsKey("rewardItem"))
            {
                rewardItem = (string)configuration["rewardItem"];
            }

            UnityAds.OnShow           += UnityAdsShow;
            UnityAds.OnHide           += UnityAdsHide;
            UnityAds.OnVideoCompleted += UnityAdsVideoCompleted;
            UnityAds.OnVideoStarted   += UnityAdsVideoStarted;

            ShowOptionsExtended extendedOptions = options as ShowOptionsExtended;

            if (extendedOptions != null && extendedOptions.gamerSid != null && extendedOptions.gamerSid.Length > 0)
            {
                if (!UnityAds.show(videoZoneId, rewardItem, new Dictionary <string, string>()
                {
                    { "sid", extendedOptions.gamerSid }
                }))
                {
                    triggerEvent(EventType.error, EventArgs.Empty);
                }
            }
            else
            {
                if (!UnityAds.show(videoZoneId, rewardItem))
                {
                    triggerEvent(EventType.error, EventArgs.Empty);
                }
            }
        }
예제 #3
0
        // Token: 0x0600015F RID: 351 RVA: 0x00004F9C File Offset: 0x0000319C
        public void Show(string zoneId = null, ShowOptions options = null)
        {
            string text = null;

            UnityAds._resultDelivered = false;
            if (options != null)
            {
                if (options.resultCallback != null)
                {
                    UnityAds.resultCallback = options.resultCallback;
                }
                ShowOptionsExtended showOptionsExtended = options as ShowOptionsExtended;
                if (showOptionsExtended != null && showOptionsExtended.gamerSid != null && showOptionsExtended.gamerSid.Length > 0)
                {
                    text = showOptionsExtended.gamerSid;
                }
                else
                {
                    text = options.gamerSid;
                }
            }
            if (!UnityAds.isInitialized || UnityAds.isShowing)
            {
                UnityAds.deliverCallback(ShowResult.Failed);
                return;
            }
            if (text != null)
            {
                if (!UnityAds.show(zoneId, string.Empty, new Dictionary <string, string>
                {
                    {
                        "sid",
                        text
                    }
                }))
                {
                    UnityAds.deliverCallback(ShowResult.Failed);
                }
            }
            else if (!UnityAds.show(zoneId))
            {
                UnityAds.deliverCallback(ShowResult.Failed);
            }
        }
        public override void Show(string zoneId, string adapterId, ShowOptions options = null)
        {
            Dictionary <string, object> configuration = _configurations[zoneId + adapterId];

            if (configuration != null && configuration.ContainsKey("network"))
            {
                UnityAds.setNetwork((string)configuration["network"]);
            }
            string videoZoneId = null;
            string rewardItem  = "";

            if (configuration != null && configuration.ContainsKey("zone"))
            {
                videoZoneId = (string)configuration["zone"];
            }
            if (configuration != null && configuration.ContainsKey("rewardItem"))
            {
                rewardItem = (string)configuration["rewardItem"];
            }

            UnityAds.OnShow           += UnityAdsShow;
            UnityAds.OnHide           += UnityAdsHide;
            UnityAds.OnVideoCompleted += UnityAdsVideoCompleted;
            UnityAds.OnVideoStarted   += UnityAdsVideoStarted;

            ShowOptionsExtended extendedOptions = options as ShowOptionsExtended;

            if (extendedOptions != null && extendedOptions.gamerSid != null && extendedOptions.gamerSid.Length > 0)
            {
                UnityAds.show(videoZoneId, rewardItem, new Dictionary <string, string>()
                {
                    { "sid", extendedOptions.gamerSid }
                });
            }
            else
            {
                UnityAds.show(videoZoneId, rewardItem);
            }
        }
예제 #5
0
 // Token: 0x06000161 RID: 353 RVA: 0x00005077 File Offset: 0x00003277
 public static bool show(string zoneId, string rewardItemKey)
 {
     return(UnityAds.show(zoneId, rewardItemKey, null));
 }
예제 #6
0
 // Token: 0x06000160 RID: 352 RVA: 0x00005069 File Offset: 0x00003269
 public static bool show(string zoneId = null)
 {
     return(UnityAds.show(zoneId, string.Empty, null));
 }