コード例 #1
0
    public override void Show(AdsElement type)
    {
        if (!AdsController.NoAds)
        {
            switch (type.type)
            {
            case AdsType.Interstitial:
                HZShowOptions showOptions = new HZShowOptions();
                showOptions.Tag = type.name;
                HZInterstitialAd.ShowWithOptions(showOptions);
                break;

            case AdsType.Video:
                HZShowOptions showOptionsVideo = new HZShowOptions();
                showOptionsVideo.Tag = type.name;
                HZVideoAd.ShowWithOptions(showOptionsVideo);
                break;

            case AdsType.RewardedVideo:
                HZIncentivizedShowOptions showOptionsReward = new HZIncentivizedShowOptions();
                showOptionsReward.Tag = type.name;
                HZIncentivizedAd.ShowWithOptions(showOptionsReward);
                break;
            }
        }
    }
コード例 #2
0
 private void ShowVideo()
 {
     // Later, such as after a level is completed
     if (HZVideoAd.IsAvailable("video"))
     {
         HZShowOptions showOptions = new HZShowOptions();
         showOptions.Tag = "video";
         HZVideoAd.ShowWithOptions(showOptions);
         VideoAdCointer = 0;
         Defs.MuteSounds(true);
     }
 }
コード例 #3
0
        public void ShowVideoAd(string tag)
        {
            if (HZVideoAd.IsAvailable(tag) && canShowAd && !adsRemoved)
            {
                Toaster.ShowDebugToast("Showing Video ad for tag; " + tag);

                HZShowOptions options = new HZShowOptions();
                options.Tag = tag;
                HZVideoAd.ShowWithOptions(options);
            }
            else
            {
                Toaster.ShowDebugToast("Can't show Video ad for tag; " + tag);
            }
        }
コード例 #4
0
    public void ShowButton()
    {
        string tag = this.adTag();

        HZShowOptions showOptions = new HZShowOptions();

        showOptions.Tag = tag;

        HZIncentivizedShowOptions incentivizedOptions = new HZIncentivizedShowOptions();

        incentivizedOptions.Tag = tag;
        incentivizedOptions.IncentivizedInfo = "test app incentivized info!";

        HZBannerShowOptions bannerOptions = new HZBannerShowOptions();

        bannerOptions.Tag      = tag;
        bannerOptions.Position = this.bannerPosition;

        HZOfferWallShowOptions offerwallOptions = new HZOfferWallShowOptions();

        offerwallOptions.ShouldCloseAfterFirstClick = offerwallCloseOnFirstClickToggle.isOn;
        offerwallOptions.Tag = tag;

        this.console.Append("Showing " + this.SelectedAdType.ToString() + " with tag: " + tag);
        switch (this.SelectedAdType)
        {
        case AdType.Interstitial:
            HZInterstitialAd.ShowWithOptions(showOptions);
            break;

        case AdType.Video:
            HZVideoAd.ShowWithOptions(showOptions);
            break;

        case AdType.Incentivized:
            HZIncentivizedAd.ShowWithOptions(incentivizedOptions);
            break;

        case AdType.Banner:
            HZBannerAd.ShowWithOptions(bannerOptions);
            break;

        case AdType.Offerwall:
            HZOfferWallAd.ShowWithOptions(offerwallOptions);
            break;
        }
    }