コード例 #1
0
        public void onRewardedAdLoaded(string placement)
        {
            updateStatusUI("Rewarded Ad Winner: " + FreestarUnityBridge.GetRewardedAdWinner(placement) + " Placement: [" + placement + "]");

            //reward ad is ready!  You can display now, or you can wait until a later time.
            showRewardedAd();
        }
コード例 #2
0
        public void onInterstitialAdLoaded(string placement)
        {
            //interstitial ad is ready!  You can display now, or you can wait until a later time.
            //updateStatusUI("Interstitial Ad Winner: " + FreestarUnityBridge.GetInterstitialAdWinner(placement) + " Placement: [" + placement + "]");
            string str = "Interstitial: " + FreestarUnityBridge.GetInterstitialAdWinner(placement);

            updateStatusUI(str);
            showInterstitialAd();
        }
コード例 #3
0
        public void loadMRECBannerAd()
        {
            log("Load MREC Banner Ad...");
            if (FreestarUnityBridge.IsBannerAdShowing(null, FreestarConstants.BANNER_AD_SIZE_320x50))
            {
                FreestarUnityBridge.CloseBannerAd(null, FreestarConstants.BANNER_AD_SIZE_320x50);
            }

            FreestarUnityBridge.ShowBannerAd(null, FreestarConstants.BANNER_AD_SIZE_300x250, FreestarConstants.BANNER_AD_POSITION_BOTTOM);
        }
コード例 #4
0
        public void loadSmallBannerAd()
        {
            updateStatusUI("Loading Banner ad...");
            if (FreestarUnityBridge.IsBannerAdShowing(null, FreestarConstants.BANNER_AD_SIZE_300x250))
            {
                FreestarUnityBridge.CloseBannerAd(null, FreestarConstants.BANNER_AD_SIZE_300x250);
            }

            FreestarUnityBridge.ShowBannerAd(null, FreestarConstants.BANNER_AD_SIZE_320x50, FreestarConstants.BANNER_AD_POSITION_BOTTOM);
        }
コード例 #5
0
 void OnApplicationFocus(bool hasFocus)
 {
     if (hasFocus)
     {
         FreestarUnityBridge.Resume();
     }
     else
     {
         FreestarUnityBridge.Pause();
     }
 }
コード例 #6
0
        public void onBannerAdShowing(string placement, int adSize)
        {
            if (adSize == FreestarConstants.BANNER_AD_SIZE_300x250)
            {
                updateStatusUI("MREC Ad: " + FreestarUnityBridge.GetBannerAdWinner(placement, adSize));
            }
            else
            {
                updateStatusUI("Banner Ad: " + FreestarUnityBridge.GetBannerAdWinner(placement, adSize));
            }

            log("onBannerAdShowing placement=[" + placement + "] adSize: " + adSize);
        }
コード例 #7
0
        private void Start()
        {
            log("Start");

            FreestarUnityBridge.SetAdRequestTestMode(true, "xxxxxxxx"); //OPTIONAL TEST MODE
            FreestarUnityBridge.ShowPartnerChooser(true);               //ONLY FOR TESTING PURPOSES; TURN OFF FOR PRODUCTION!

#if UNITY_ANDROID
            FreestarUnityBridge.initWithAPIKey("XqjhRR");  //Android TEST KEY  Replace with yours in production.
#endif

#if UNITY_IOS
            FreestarUnityBridge.initWithAPIKey("X4mdFv"); //iOS TEST KEY  Replace with yours in production.
#endif

            FreestarUnityBridge.setBannerAdListener(this);
            FreestarUnityBridge.setInterstitialAdListener(this);
            FreestarUnityBridge.setRewardedAdListener(this);
        }
コード例 #8
0
 //Be sure to unRegister before loading a new scene.
 private void unRegisterAdListener()
 {
     FreestarUnityBridge.removeBannerAdListener();
     FreestarUnityBridge.removeRewardedAdListener();
     FreestarUnityBridge.removeInterstitialAdListener();
 }
コード例 #9
0
 private void showRewardedAd()           //called when btnShowReward Clicked
 {
     log("Show Reward Ad...");
     FreestarUnityBridge.showRewardedAd("", 30, "coins", "", "qwer1234");
 }
コード例 #10
0
        //===============Rewarded Video Ad Methods===============

        /**
         * Called when Load Rewarded Ad button is clicked
         */
        public void loadRewardedAd()
        {
            log("Load Reward Ad...");
            FreestarUnityBridge.loadRewardedAd("");
        }
コード例 #11
0
 private void showInterstitialAd()
 {
     log("Show Interstitial Ad...");
     FreestarUnityBridge.showInterstitialAd("");
 }
コード例 #12
0
        //===============Interstitial Ad Methods===============

        public void loadInterstitialAd()     //called when Interstitial button clicked
        {
            log("Load Interstitial Ad...");
            FreestarUnityBridge.loadInterstitialAd("");
        }
コード例 #13
0
        //===============Rewarded Video Ad Methods===============

        /**
         * Called when Load Rewarded Ad button is clicked
         */
        public void loadRewardedAd()
        {
            updateStatusUI("Loading rewarded...");
            FreestarUnityBridge.LoadRewardedAd("");
        }
コード例 #14
0
        //===============Interstitial Ad Methods===============

        public void loadInterstitialAd()     //called when Interstitial button clicked
        {
            updateStatusUI("Loading interstitial...");
            FreestarUnityBridge.LoadInterstitialAd("");
        }