コード例 #1
0
        // Creates RewardVideoAd instance.
        public RewardVideoAd(string adAppId, string adUnitId, AdOptions adOptions)
        {
            client = ZPLAYAdsClientFactory.BuildRewardVideoClient(adAppId, adUnitId);

            if (adOptions == null)
            {
                adOptions = new AdOptionsBuilder().build();
            }
            client.SetChannelId(adOptions.mChannelId);
            client.SetAutoloadNext(adOptions.isAutoLoad);

            client.OnAdLoaded += (sender, args) =>
            {
                if (OnAdLoaded != null)
                {
                    OnAdLoaded(this, args);
                }
            };

            client.OnAdFailedToLoad += (sender, args) =>
            {
                if (OnAdFailedToLoad != null)
                {
                    OnAdFailedToLoad(this, args);
                }
            };

            client.OnAdStarted += (sender, args) =>
            {
                if (OnAdStarted != null)
                {
                    OnAdStarted(this, args);
                }
            };

            client.OnAdClicked += (sender, args) =>
            {
                if (OnAdClicked != null)
                {
                    OnAdClicked(this, args);
                }
            };

            client.OnAdRewarded += (sender, args) =>
            {
                if (OnAdRewarded != null)
                {
                    OnAdRewarded(this, args);
                }
            };

            client.OnAdClosed += (sender, args) =>
            {
                if (OnAdClosed != null)
                {
                    OnAdClosed(this, args);
                }
            };
        }
コード例 #2
0
 public BannerView(string adAppId, string adUnitId, BannerViewOptions options)
 {
     bannerClient = ZPLAYAdsClientFactory.BuildBannerClient();
     bannerClient.CreateBannerView(adAppId, adUnitId, options);
     ConfigureBannerEvents();
 }