コード例 #1
0
        public AdView(string placementId,
                      AdSize size)
        {
            AudienceNetworkAds.Initialize();

            PlacementId = placementId;
            this.size   = size;

            if (Application.platform != RuntimePlatform.OSXEditor)
            {
                uniqueId = AdViewBridge.Instance.Create(placementId, this, size);

                AdViewBridge.Instance.OnLoad(uniqueId, AdViewDidLoad);
                AdViewBridge.Instance.OnImpression(uniqueId, AdViewWillLogImpression);
                AdViewBridge.Instance.OnClick(uniqueId, AdViewDidClick);
                AdViewBridge.Instance.OnError(uniqueId, AdViewDidFailWithError);
                AdViewBridge.Instance.OnFinishedClick(uniqueId, AdViewDidFinishClick);
            }
        }
コード例 #2
0
        public InterstitialAd(string placementId)
        {
            AudienceNetworkAds.Initialize();

            PlacementId = placementId;

            if (Application.platform != RuntimePlatform.OSXEditor)
            {
                uniqueId = InterstitialAdBridge.Instance.Create(placementId, this);

                InterstitialAdBridge.Instance.OnLoad(uniqueId, InterstitialAdDidLoad);
                InterstitialAdBridge.Instance.OnImpression(uniqueId, InterstitialAdWillLogImpression);
                InterstitialAdBridge.Instance.OnClick(uniqueId, InterstitialAdDidClick);
                InterstitialAdBridge.Instance.OnError(uniqueId, InterstitialAdDidFailWithError);
                InterstitialAdBridge.Instance.OnWillClose(uniqueId, InterstitialAdWillClose);
                InterstitialAdBridge.Instance.OnDidClose(uniqueId, InterstitialAdDidClose);
                InterstitialAdBridge.Instance.OnActivityDestroyed(uniqueId, InterstitialAdActivityDestroyed);
            }
        }
コード例 #3
0
        public RewardedVideoAd(string placementId, RewardData rewardData)
        {
            AudienceNetworkAds.Initialize();

            PlacementId = placementId;
            RewardData  = rewardData;

            if (Application.platform != RuntimePlatform.OSXEditor)
            {
                uniqueId = RewardedVideoAdBridge.Instance.Create(placementId, RewardData, this);

                RewardedVideoAdBridge.Instance.OnLoad(uniqueId, RewardedVideoAdDidLoad);
                RewardedVideoAdBridge.Instance.OnImpression(uniqueId, RewardedVideoAdWillLogImpression);
                RewardedVideoAdBridge.Instance.OnClick(uniqueId, RewardedVideoAdDidClick);
                RewardedVideoAdBridge.Instance.OnError(uniqueId, RewardedVideoAdDidFailWithError);
                RewardedVideoAdBridge.Instance.OnWillClose(uniqueId, RewardedVideoAdWillClose);
                RewardedVideoAdBridge.Instance.OnDidClose(uniqueId, RewardedVideoAdDidClose);
                RewardedVideoAdBridge.Instance.OnComplete(uniqueId, RewardedVideoAdComplete);
                RewardedVideoAdBridge.Instance.OnDidSucceed(uniqueId, RewardedVideoAdDidSucceed);
                RewardedVideoAdBridge.Instance.OnDidFail(uniqueId, RewardedVideoAdDidFail);
                RewardedVideoAdBridge.Instance.OnActivityDestroyed(uniqueId, RewardedVideoAdActivityDestroyed);
            }
        }