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();
        }
    }
예제 #2
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
    }
예제 #3
0
    public void _initPlugins()
    {
        FB.Init(OnInitComplete);
        _isEnabled = true;
        Debug.Log("C# _initPlugins");
        _isInited    = true;
        _flurryProxy = new NerdFlurry();

        #if UNITY_ANDROID && !UNITY_EDITOR
        _flurryProxy.StartSession(Settings.instance.flurryAndroid);
        Debug.Log("C# CBBinding.init()");
        #elif UNITY_IPHONE && !UNITY_EDITOR
        _flurryProxy.StartSession(Settings.instance.flurryIOS);
        #endif
        #if (UNITY_ANDROID || UNITY_IPHONE) && !UNITY_EDITOR
        PlayHavenManager.instance.OpenNotification();
        #endif

        #if UNITY_ANDROID && !UNITY_EDITOR
        CBBinding.init();
        #elif UNITY_IPHONE && !UNITY_EDITOR
        CBBinding.init(Settings.instance.chartboostID, Settings.instance.chartboostSignature);
        #endif
        CBBinding.cacheInterstitial(null);
        CBBinding.cacheMoreApps();

        PlayHavenManager.instance.ContentPreloadRequest(Settings.instance.playhavenFullscreen);
    }
예제 #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
    }
예제 #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);
             }
         }
     }
 }
예제 #7
0
 // Use this for initialization
 void Start()
 {
     CBBinding.cacheInterstitial("Default");
 }
예제 #8
0
 void didDismissInterstitialEvent(string location)
 {
     CBBinding.cacheInterstitial(location);
     shown = true;
 }