Пример #1
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
    }
    void OnApplicationPause(bool paused)
    {
#if UNITY_ANDROID
        // Manage Chartboost plugin lifecycle
        CBBinding.pause(paused);
#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);
    }
    void OnDisable()
    {
        // Shut down the Chartboost plugin
#if UNITY_ANDROID
        CBBinding.destroy();
#endif
    }
Пример #5
0
    void Update()
    {
        if (GA.SettingsGA.Start_TimePlayed)
        {
            _timePlayed += Time.deltaTime;

            if (_timePlayed >= GA.SettingsGA.TimePlayed)
            {
                EnableAds();
            }
        }

                #if UNITY_ANDROID && CB_ON
        if (GA.SettingsGA.CB_enabled)
        {
            // Handle the Android back button
            if (Input.GetKeyUp(KeyCode.Escape))
            {
                // Check if Chartboost wants to respond to it
                if (CBBinding.onBackPressed())
                {
                    // If so, return and ignore it
                    return;
                }
                else
                {
                    // Otherwise, handle it ourselves -- let's close the app
                    Application.Quit();
                }
            }
        }
                #endif
    }
Пример #6
0
 private void ShowCB()
 {
             #if CB_ON
     CBBinding.showInterstitial("default");
     _adShowing = true;
             #endif
 }
    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();
        }
    }
Пример #8
0
 void OnApplicationPause(bool pause)
 {
     if (!pause && _isInited)
     {
         PlayHavenManager.instance.OpenNotification();
         CBBinding.init();
     }
 }
Пример #9
0
 void Awake()
 {
             #if UNITY_ANDROID
     CBBinding.init("53f21e95c26ee458330317de", "9ab37c612b65f80243149d6fcebf64513792abe5");
     //#elif UNITY_IPHONE
     //CBBinding.init("3333", "4444");
             #endif
 }
Пример #10
0
 void Awake()
 {
     #if UNITY_ANDROID
     CBBinding.init("1111", "2222");
     #elif UNITY_IPHONE
     CBBinding.init("3333", "4444");
     #endif
 }
Пример #11
0
 void Awake()
 {
     #if UNITY_ANDROID
     CBBinding.init("53e988de89b0bb54c915b841", "2d13bde84275bb908d1acc64c0d8aae310061f26");
     #elif UNITY_IPHONE
     CBBinding.init("3333", "4444");
     #endif
 }
Пример #12
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         #if UNITY_ANDROID
         if (CBBinding.onBackPressed())
         {
             return;
         }
         else
         {
             Application.Quit();
         }
         #else
         Application.Quit();
         #endif
     }
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         if (Time.frameCount % 30 == 0)
         {
             System.GC.Collect();
         }
     }
     if (Score.TotalScore >= 1000)
     {
         #if UNITY_ANDROID
         SocialManager.UnlockAchievement("CgkIz-zNrP8bEAIQBQ");
                     #elif UNITY_IPHONE
         SocialManager.UnlockAchievement("CgkI_uuXy7ESEAIQBg");
         #endif
     }
     else if (Score.TotalScore >= 100)
     {
         #if UNITY_ANDROID
         SocialManager.UnlockAchievement("CgkIz-zNrP8bEAIQBA");
         #elif UNITY_IPHONE
         SocialManager.UnlockAchievement("CgkI_uuXy7ESEAIQBQ");
         #endif
     }
     else if (Score.TotalScore >= 50)
     {
         #if UNITY_ANDROID
         SocialManager.UnlockAchievement("CgkIz-zNrP8bEAIQAw");
                     #elif UNITY_IPHONE
         SocialManager.UnlockAchievement("CgkI_uuXy7ESEAIQBA");
         #endif
     }
     else if (Score.TotalScore >= 1)
     {
         #if UNITY_ANDROID
         SocialManager.UnlockAchievement("CgkIz-zNrP8bEAIQAg");
                     #elif UNITY_IPHONE
         SocialManager.UnlockAchievement("CgkI_uuXy7ESEAIQAw");
         #endif
     }
 }
Пример #13
0
    // Use this for initialization
    void Start()
    {
                #if UNITY_ANDROID
        CBBinding.init();
                #endif

        CBBinding.cacheInterstitial(null);
        CBBinding.showInterstitial(null);
    }
Пример #14
0
 void Update()
 {
     if (Input.GetKeyUp(KeyCode.Escape))
     {
         if (_isInited && CBBinding.onBackPressed())
         {
             return;
         }
     }
 }
Пример #15
0
    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("4f21c409cd1cb2fb7000001b", "92e2de2fd7070327bdeb54c15a5295309c6fcd2d");
#endif
    }
    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("53684a5689b0bb39b463ae06", "e0b9c61661fe85dcc4ae05106a244fa787f5d849");
#elif UNITY_IPHONE
        // Replace these with your own iOS app ID and signature from the Chartboost web portal
        CBBinding.init("4f21c409cd1cb2fb7000001b", "92e2de2fd7070327bdeb54c15a5295309c6fcd2d");
#endif
    }
Пример #17
0
    void OnEnable()
    {
        // Initialize the Chartboost plugin
#if UNITY_ANDROID
        // Remember to set the Android app ID and signature in the file `/Plugins/Android/res/values/strings.xml`
        CBBinding.init();
#elif UNITY_IPHONE
        // Replace these with your own app ID and signature from the Chartboost web portal
        CBBinding.init("4f21c409cd1cb2fb7000001b", "92e2de2fd7070327bdeb54c15a5295309c6fcd2d");
#endif
    }
    // Use this for initialization
    void Start()
    {
        Debug.Log("ChartboostPersistentObject => Start()");
#if UNITY_ANDROID
        CBBinding.init(charboostAppID_Android, charboostAppSignature_Android);
        Debug.Log("ChartboostPersistentObject => Start() => CBBinding.init(" + charboostAppID_Android + ", " + charboostAppSignature_Android + ") => CBBinding.cacheInterstitial(null)");
#elif UNITY_IPHONE
        CBBinding.init(charboostAppID_IOS, charboostAppSignature_IOS);
        Debug.Log("ChartboostPersistentObject => Start() => CBBinding.init(" + charboostAppID_IOS + ", " + charboostAppSignature_IOS + ") => CBBinding.cacheInterstitial(null)");
#endif
        //CBBinding.cacheInterstitial(null);
        //ShowChartboostAdd();
    }
    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(charboostAppID_Android, charboostAppSignature_Android);
        Debug.Log("ChartboostPersistentObject => OnEnable() => CBBinding.init(" + charboostAppID_Android + ", " + charboostAppSignature_Android + ")");
#elif UNITY_IPHONE
        // Replace these with your own iOS app ID and signature from the Chartboost web portal
        CBBinding.init(charboostAppID_IOS, charboostAppSignature_IOS);
        Debug.Log("ChartboostPersistentObject => OnEnable() => CBBinding.init(" + charboostAppID_IOS + ", " + charboostAppSignature_IOS + ")");
#endif
    }
 public void Update()
 {
     if (Input.GetKeyUp(KeyCode.Escape))
     {
         if (CBBinding.onBackPressed())
         {
             return;
         }
         else
         {
             Application.Quit();
         }
     }
 }
    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
    }
Пример #22
0
    public void moreGames()
    {
        if (!_isEnabled)
        {
            return;
        }

        Debug.Log("C# moreGames");

        if (CBBinding.hasCachedMoreApps())
        {
            CBBinding.showMoreApps();
            Debug.Log("C# moreGames chartboost");
        }

        CBBinding.cacheMoreApps();
    }
Пример #23
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 Update()
    {
#if UNITY_ANDROID
        // Handle the Android back button (only if impressions are set to not use activities)
        if (Input.GetKeyUp(KeyCode.Escape))
        {
            // Check if Chartboost wants to respond to it
            if (CBBinding.onBackPressed())
            {
                // If so, return and ignore it
                return;
            }
            else
            {
                // Otherwise, handle it ourselves -- let's close the app
                Application.Quit();
            }
        }
#endif
    }
Пример #25
0
 // Use this for initialization
 void Start()
 {
     CBBinding.cacheInterstitial("Default");
 }
Пример #26
0
 void OnApplicationPause(bool paused)
 {
             #if UNITY_ANDROID
     CBBinding.pause(paused);
             #endif
 }
Пример #27
0
 void OnApplicationQuit()
 {
             #if UNITY_ANDROID
     CBBinding.destroy();
             #endif
 }
 void OnDisable()
 {
     // Shut down the Chartboost plugin
     CBBinding.destroy();
 }
 void OnApplicationPause(bool paused)
 {
     // Manage Chartboost plugin lifecycle
     CBBinding.pause(paused);
 }
 public void ShowChartboostAdd()
 {
     Debug.Log("ChartboostPersistentObject => ShowChartboostAdd() => CBBinding.showInterstitial(null)");
     CBBinding.showInterstitial(null);
 }