Advertisement
Guest User

AdTrigg

a guest
Nov 28th, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. public class chartBoostAdverts : MonoBehaviour
  2. {
  3.     #if UNITY_ANDROID
  4.     int ClickCounter = 0;
  5.  
  6.     void Start()
  7.     {
  8.         ClickCounter = PlayerPrefs.GetInt ("ClickCounter", 0);
  9.     }
  10.  
  11.  
  12.     public void showAdTrigger()
  13.     {
  14.  
  15.         ClickCounter++;
  16.         PlayerPrefs.SetInt ("ClickCounter", ClickCounter);
  17.  
  18.         if (ChartboostEventListener_HC._instance != null)
  19.         {
  20.             if (PlayerPrefs.GetInt ("CHARACTER_RemoveAds", 0) == 0) && if (ClickCounter >= 500)
  21.             {
  22.                 ChartboostEventListener_HC._instance
  23.                 ChartboostAndroid.showInterstitial ("Default");
  24.                 ClickCounter = 0;
  25.         }
  26.     }
  27.  
  28.     #endif
  29.    
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement