void OnGUI()
    {
#if UNITY_ANDROID
        // Disable user input for GUI when impressions are visible
        // This is only necessary on Android if we have disabled impression activities
        //   by having called CBBinding.init(ID, SIG, false), as that allows touch
        //   events to leak through Chartboost impressions
        GUI.enabled = !CBBinding.isImpressionVisible();
#endif

        GUI.matrix = Matrix4x4.Scale(new Vector3(2, 2, 2));

        if (GUILayout.Button("Cache Interstitial"))
        {
            CBBinding.cacheInterstitial("Default");
        }

        if (GUILayout.Button("Show Interstitial"))
        {
            CBBinding.showInterstitial("Default");
        }

        if (GUILayout.Button("Cache More Apps"))
        {
            CBBinding.cacheMoreApps();
        }

        if (GUILayout.Button("Show More Apps"))
        {
            CBBinding.showMoreApps();
        }
    }
Exemplo n.º 2
0
 private void ShowCB()
 {
             #if CB_ON
     CBBinding.showInterstitial("default");
     _adShowing = true;
             #endif
 }
Exemplo n.º 3
0
    public void showBanner()
    {
        if (UserData.adRemoved)
        {
            return;
        }

        #if (UNITY_ANDROID || UNITY_IPHONE) && !UNITY_EDITOR
        if (_needChartboost && CBBinding.hasCachedInterstitial(null))
        {
            Debug.Log("C# chartboost banner");
            CBBinding.showInterstitial(null);
        }
        else
        {
            Debug.Log("C# playhaven banner");
            PlayHavenManager.instance.ContentRequest(Settings.instance.playhavenFullscreen, true);
            PlayHavenManager.instance.ContentPreloadRequest(Settings.instance.playhavenFullscreen);
        }

        if (_needChartboost)
        {
            CBBinding.cacheInterstitial(null);
        }

        _needChartboost = !_needChartboost;
        #endif
    }
Exemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
                #if UNITY_ANDROID
        CBBinding.init();
                #endif

        CBBinding.cacheInterstitial(null);
        CBBinding.showInterstitial(null);
    }
    void OnEnable()
    {
        // Initialize the Chartboost plugin

                #if UNITY_ANDROID
        // Replace these with your own Android app ID and signature from the Chartboost web portal
        CBBinding.init("4f7b433509b6025804000002", "dd2d41b69ac01b80f443f5b6cf06096d457f82bd");
                #elif UNITY_IPHONE
        // Replace these with your own iOS app ID and signature from the Chartboost web portal
        CBBinding.init("53B28105C26Ee40B38966A37", "f0af312cb37ba17eb8a2a65d6d6770fc7ce96368");
        CBBinding.cacheInterstitial("Default");
        CBBinding.showInterstitial("Default");
                #endif
    }
Exemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     if (System.String.Compare(Application.loadedLevelName, "GameOver") == 0)
     {
         if (ChartboostConfig.wasShown == false)
         {
             CBBinding.showInterstitial(null);
             CBBinding.cacheInterstitial(null);
             ChartboostConfig.wasShown = true;
         }
         else
         {
             if (Random.Range(0, 3) == 1)
             {
                 CBBinding.showInterstitial(null);
                 CBBinding.cacheInterstitial(null);
             }
         }
     }
 }
 public void ShowChartboostAdd()
 {
     Debug.Log("ChartboostPersistentObject => ShowChartboostAdd() => CBBinding.showInterstitial(null)");
     CBBinding.showInterstitial(null);
 }
Exemplo n.º 8
0
 public void ShowAd(string location = null)
 {
     CBBinding.showInterstitial(location);
 }