Beispiel #1
0
    void Start()
    {
        AdTapsy.SetTestMode(true, "0939F9B5190D9FFFE196393EC8B96A5F", "a46f0617d60d5f1b19b554c6014f364a");
        AdTapsy.OnAdShown        += delegate { UnityEngine.Debug.Log("***AdTapsySDK.OnAdShown***"); };
        AdTapsy.OnAdSkipped      += delegate { UnityEngine.Debug.Log("***AdTapsySDK.OnAdSkipp***"); };
        AdTapsy.OnAdFailedToShow += delegate { UnityEngine.Debug.Log("***AdTapsySDK.OnAdFailedToShow***"); };
        AdTapsy.OnAdClicked      += delegate { UnityEngine.Debug.Log("***AdTapsySDK.OnAdClicked***"); };

        AdTapsy.StartSessionAndroid("54982cf7e4b052cd2a20a7b8");
        AdTapsy.StartSessionIOS("539777bae4b02eacca4bcb67");
    }
Beispiel #2
0
 void ShowRewardedVideo()
 {
     if (AdTapsy.IsRewardedVideoReadyToShow())
     {
         UnityEngine.Debug.Log("Ad is ready to be shown");
         AdTapsy.ShowRewardedVideo();
     }
     else
     {
         UnityEngine.Debug.Log("Ad is not ready to be shown");
     }
 }
Beispiel #3
0
 void ShowInterstitial()
 {
     if (AdTapsy.IsInterstitialReadyToShow())
     {
         UnityEngine.Debug.Log("Ad is ready to be shown");
         AdTapsy.ShowInterstitial();
     }
     else
     {
         UnityEngine.Debug.Log("Ad is not ready to be shown");
     }
 }
Beispiel #4
0
    void OnGUI()
    {
        int      buttonWidth  = 300;
        int      buttonHeight = 180;
        GUIStyle buttonStyle  = new GUIStyle("button");

        buttonStyle.fontSize = 40;
        if (GUI.Button(new Rect(Screen.width / 2 - buttonWidth / 2, Screen.height / 2 - buttonHeight / 2, buttonWidth, buttonHeight), "Show ad", buttonStyle))
        {
            AdTapsy.ShowInterstitial();
        }
    }
Beispiel #5
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         /* AdTapsy.CloseAd returns whether an interstitial was closed.
          * If so don't do anything, else handle your events
          */
         bool adClosed = AdTapsy.CloseAd();
         if (!adClosed)
         {
             Application.Quit();
         }
     }
 }
Beispiel #6
0
    void Start()
    {
        AdTapsy.SetRewardedVideoAmount(10);
        AdTapsy.SetRewardedVideoPostPopupEnabled(false);
        AdTapsy.SetRewardedVideoPrePopupEnabled(false);
        AdTapsy.SetTestMode(true, "0939F9B5190D9FFFE196393EC8B96A5F", "a46f0617d60d5f1b19b554c6014f364a");
        AdTapsy.OnAdCached += delegate(int zoneId) {
            if (zoneId == AdTapsy.InterstitialZone)
            {
                UnityEngine.Debug.Log("***AdTapsy cached interstitial ad***");
            }
            else if (zoneId == AdTapsy.RewardedVideoZone)
            {
                UnityEngine.Debug.Log("***AdTapsy cached rewarded ad***");
            }
        };
        AdTapsy.OnAdShown += delegate(int zoneId){
            if (zoneId == AdTapsy.InterstitialZone)
            {
                UnityEngine.Debug.Log("***AdTapsy showed interstitial ad***");
            }
            else if (zoneId == AdTapsy.RewardedVideoZone)
            {
                UnityEngine.Debug.Log("***AdTapsy showed rewarded ad***");
            }
        };
        AdTapsy.OnAdSkipped += delegate(int zoneId){
            if (zoneId == AdTapsy.InterstitialZone)
            {
                UnityEngine.Debug.Log("***AdTapsy skipped interstitial ad***");
            }
            else if (zoneId == AdTapsy.RewardedVideoZone)
            {
                UnityEngine.Debug.Log("***AdTapsy skipped rewarded ad***");
            }
        };
        AdTapsy.OnAdFailedToShow += delegate(int zoneId) {
            if (zoneId == AdTapsy.InterstitialZone)
            {
                UnityEngine.Debug.Log("***AdTapsy failed to show interstitial ad***");
            }
            else if (zoneId == AdTapsy.RewardedVideoZone)
            {
                UnityEngine.Debug.Log("***AdTapsy failed to show rewarded ad***");
            }
        };
        AdTapsy.OnAdClicked += delegate(int zoneId) {
            if (zoneId == AdTapsy.InterstitialZone)
            {
                UnityEngine.Debug.Log("***AdTapsy clicked interstitial ad***");
            }
            else if (zoneId == AdTapsy.RewardedVideoZone)
            {
                UnityEngine.Debug.Log("***AdTapsy clicked rewarded ad***");
            }
        };
        AdTapsy.OnRewardEarned += delegate(int amount){
            UnityEngine.Debug.Log("***AdTapsy reward earned " + amount + "***");
        };

        AdTapsy.StartSessionAndroid("54982cf7e4b052cd2a20a7b8");
        AdTapsy.StartSessionIOS("539777bae4b02eacca4bcb67");
    }
Beispiel #7
0
 // Use this for initialization
 void Start()
 {
     AdTapsy.StartSessionAndroid("551b3c18e4b0eb64412af40a");
 }
Beispiel #8
0
 public void ShowIntertial()
 {
     AdTapsy.ShowInterstitial();
 }