Example #1
0
 private void Advertising_RewardedAdCompleted(RewardedAdNetwork arg1, AdPlacement arg2)
 {
     text.text = "COMPLETED AD";
 }
Example #2
0
 private void RewardedAdSkippedHandler(RewardedAdNetwork network, AdPlacement location)
 {
     Advertising.RewardedAdSkipped   -= RewardedAdSkippedHandler;
     Advertising.RewardedAdCompleted -= RewardedAdCompletedHandler;
     ShowNotAvailableWindow();
 }
Example #3
0
    // Event handler called when a rewarded ad has been skipped
    private void RewardedAdSkippedHandler(RewardedAdNetwork network, AdPlacement location)
    {
        Debug.Log("Rewarded ad was skipped. The user should NOT be rewarded.");

        StartCoroutine(EventManager.Instance.GameOverTrigger?.Invoke(GameOverType.WrongAnswer));
    }
Example #4
0
 protected override void DestroyBanner()
 {
     Advertising.DestroyBannerAd(
         SelectedNetwork,
         AdPlacement.PlacementWithName(customKeyInputField.text));
 }
Example #5
0
 protected override void LoadAd()
 {
     Advertising.LoadInterstitialAd(SelectedNetwork, AdPlacement.PlacementWithName(CustomKey));
 }
 private void Advertising_RewardedAdCompleted(RewardedAdNetwork arg1, AdPlacement arg2)
 {
     DoRespawn();
 }
Example #7
0
 public bool IsAdReady(AdPlacement placement)
 {
     return(true);
 }
Example #8
0
 public AdResultData(AdPlacement placement, AdResult result, string provider)
 {
     this.placement = placement;
     this.result    = result;
     this.provider  = provider;
 }
Example #9
0
 void Advertising_RewardedAdCompleted(RewardedAdNetwork network, AdPlacement loc)
 {
     adNetwork.Value = network;
     Fsm.Event(eventTarget, adCompletedEvent);
 }
Example #10
0
 public bool IsAdReady(AdPlacement placement)
 {
     return(adsProviderService.IsAdReady(placement));
 }
Example #11
0
 protected override void LoadAd()
 {
     Advertising.LoadRewardedAd(SelectedNetwork, AdPlacement.PlacementWithName(CustomKey));
 }
Example #12
0
 private void InterstitialAdCompletedHandler(InterstitialAdNetwork network, AdPlacement location)
 {
     ResetCount();
     Advertising.LoadInterstitialAd();
 }
Example #13
0
 public bool HasPlacement(AdPlacement placement)
 {
     return(!this.adsDisabled && this.placements != null && this.placements.Contains(placement));
 }
Example #14
0
    public static AdConfig FromResponse(AdsServerResponse response, bool isTablet)
    {
        AdConfig adConfig = new AdConfig();

        if (!string.IsNullOrEmpty(response.adUnit_banner))
        {
            adConfig.bannerAdUnit = response.adUnit_banner;
        }
        else
        {
            adConfig.bannerAdUnit = ((!isTablet) ? "f22e60410d82403aa5e0fb791ef9c153" : "1253b5589a4d45869288611de14229d6");
        }
        if (!string.IsNullOrEmpty(response.adUnit_fullscreen))
        {
            adConfig.fsAdUnit = response.adUnit_fullscreen;
        }
        else
        {
            adConfig.fsAdUnit = ((!isTablet) ? "72bb0678c400487b8d1a941944fa6888" : "8cae328870984a9987623f9c6e52b25d");
        }
        if (!string.IsNullOrEmpty(response.adUnit_rewarded))
        {
            adConfig.rewardAdUnit = response.adUnit_rewarded;
        }
        else
        {
            adConfig.rewardAdUnit = ((!isTablet) ? "6bc3898062484e71a114d0ab59cb1c78" : "0543e571406140dd96252ac1351b99f5");
        }
        adConfig.adsDisabled        = (response.ad_module_active == 0);
        adConfig.interval           = response.interstitial_delay / 1000;
        adConfig.startInterval      = response.interstitial_delay_onstart / 1000;
        adConfig.appLaunchDelay     = (float)response.applaunch_delay / 1000f;
        adConfig.fsInternalOnReward = Mathf.Max(0, response.interstitial_delay_onreward / 1000);
        adConfig.bannerShowTime     = Mathf.Max(10, response.banner_show_time / 1000);
        adConfig.bannerLoadDelay    = Mathf.Max(1, response.banner_load_delay / 1000);
        adConfig.adsTest            = (response.ad_module_test_mode == 1);
        adConfig.placements         = new List <AdPlacement>();
        adConfig.chances            = new List <int>();
        if (response.fullscreen_showing_config != null)
        {
            for (int i = 0; i < response.fullscreen_showing_config.Length; i++)
            {
                AdsFsPlacementConfig adsFsPlacementConfig = response.fullscreen_showing_config[i];
                AdPlacement          adPlacement          = AdConfig.ParsePlacement(adsFsPlacementConfig.id);
                if (adPlacement != AdPlacement.Unknown)
                {
                    adConfig.placements.Add(adPlacement);
                    adConfig.chances.Add(Mathf.Clamp(adsFsPlacementConfig.chance, 0, 100));
                }
            }
        }
        if (response.banner_showing_config != null && response.banner_showing_config.id != null)
        {
            adConfig.bannerPos = AdConfig.ParseBannerPosition(response.banner_showing_config.show);
            if (adConfig.bannerPos != BannerPosition.None)
            {
                adConfig.bannerPlaces = new List <BannerPlacement>();
                for (int j = 0; j < response.banner_showing_config.id.Length; j++)
                {
                    BannerPlacement bannerPlacement = AdConfig.ParseBannerPlacement(response.banner_showing_config.id[j]);
                    if (bannerPlacement != BannerPlacement.Unknown)
                    {
                        adConfig.bannerPlaces.Add(bannerPlacement);
                    }
                }
            }
        }
        else
        {
            adConfig.bannerPos = BannerPosition.None;
        }
        adConfig.rewardConfig = AdConfig.FromRespone(response.rewarded_config, false);
        return(adConfig);
    }
Example #15
0
 void RewardedAdCompletedHandler(RewardedAdNetwork network, AdPlacement location) => _gameManagerScript.GameContinue();
Example #16
0
 public bool HasInterstitialPlacement(AdPlacement placement)
 {
     return(this.IsEnabled() && !this.bannerDisabled && this.config != null && this.config.HasPlacement(placement));
 }
 private void Advertising_RewardedAdSkipped(RewardedAdNetwork arg1, AdPlacement arg2)
 {
     Time.timeScale     = 1;
     InGame.playerAlive = false;
     Die();
 }
Example #18
0
 private void RewardGems(RewardedAdNetwork rewardedAdNet, AdPlacement adPlacement)
 {
     PlayerDataModel.AddCoins(countToAdd);
     Advertising.RewardedAdCompleted -= RewardGems;
 }
 public override void OnEnter()
 {
     mAdNetwork = (RewardedAdNetwork)adNetwork.Value;
     mPlacement = AdPlacement.PlacementWithName(adPlacement.Value);
 }
Example #20
0
 public UniRx.IObservable <AdWatched> TryToShow(AdPlacement placement)
 {
     return(TryToShow(placement, CurrentProvider.Value));
 }
Example #21
0
 public bool TryShowAd(AdPlacement placement)
 {
     return(true);
 }
Example #22
0
        private void OnRewardedInterstitialSkipped(RewardedInterstitialAdNetwork network, AdPlacement placement)
        {
            StartCoroutine(DelayCoroutine(GetPopupDelayTime((AdNetwork)network), () =>
                                          NativeUI.Alert("Rewarded Interstitial Ad Skipped", string.Format(
                                                             "The rewarded interstitial ad was skipped, and the user shouldn't get the reward. Network: {0}, Placement: {1}",
                                                             network, AdPlacement.GetPrintableName(placement)))));

            Debug.Log(string.Format(
                          "The rewarded interstitial ad was skipped, and the user shouldn't get the reward. Network: {0}, Placement: {1}",
                          network, AdPlacement.GetPrintableName(placement)));
        }
Example #23
0
 protected override bool IsAdReady()
 {
     return(Advertising.IsInterstitialAdReady(SelectedNetwork, AdPlacement.PlacementWithName(CustomKey)));
 }
Example #24
0
        private void OnRewardedInterstitialCompleted(RewardedInterstitialAdNetwork network, AdPlacement placement)
        {
            StartCoroutine(DelayCoroutine(GetPopupDelayTime((AdNetwork)network), () =>
                                          NativeUI.Alert("Rewarded Interstitial Ad Completed", string.Format(
                                                             "The rewarded interstitial ad has completed, this is when you should reward the user. Network: {0}, Placement: {1}",
                                                             network, AdPlacement.GetPrintableName(placement)))));

            Debug.Log(string.Format(
                          "The rewarded interstitial ad has completed, this is when you should reward the user. Network: {0}, Placement: {1}",
                          network, AdPlacement.GetPrintableName(placement)));
        }
Example #25
0
 private void RewardedAdCompletedHandler(RewardedAdNetwork network, AdPlacement location)
 {
     Advertising.RewardedAdSkipped   -= RewardedAdSkippedHandler;
     Advertising.RewardedAdCompleted -= RewardedAdCompletedHandler;
     storeReward.PurchaseCompleted();
 }
Example #26
0
 private void Advertising_RewardedAdSkipped(RewardedAdNetwork arg1, AdPlacement arg2)
 {
     text.text = "SKIPPED AD";
 }
Example #27
0
 public AdShowData(AdPlacement placement, string provider)
 {
     this.placement = placement;
     this.provider  = provider;
 }
Example #28
0
    // Event handler called when a rewarded ad has completed
    private void RewardedAdCompletedHandler(RewardedAdNetwork network, AdPlacement location)
    {
        Debug.Log("Rewarded ad has completed. The user should be rewarded now.");

        EventManager.Instance.GetQuestion?.Invoke();
    }