// Token: 0x060000FA RID: 250 RVA: 0x00006050 File Offset: 0x00004450
 private void didInitializeEvent(string data)
 {
     if (Chartboost.didInitialize != null)
     {
         Chartboost.didInitialize(Convert.ToBoolean(data));
     }
 }
 // Token: 0x0600010E RID: 270 RVA: 0x00006403 File Offset: 0x00004803
 private void didCacheRewardedVideoEvent(string location)
 {
     if (Chartboost.didCacheRewardedVideo != null)
     {
         Chartboost.didCacheRewardedVideo(CBLocation.locationFromName(location));
     }
 }
 // Token: 0x060000FF RID: 255 RVA: 0x0000612B File Offset: 0x0000452B
 private void didCacheInterstitialEvent(string location)
 {
     if (Chartboost.didCacheInterstitial != null)
     {
         Chartboost.didCacheInterstitial(CBLocation.locationFromName(location));
     }
 }
 // Token: 0x06000106 RID: 262 RVA: 0x0000626F File Offset: 0x0000466F
 private void didCacheMoreAppsEvent(string location)
 {
     if (Chartboost.didCacheMoreApps != null)
     {
         Chartboost.didCacheMoreApps(CBLocation.locationFromName(location));
     }
 }
 // Token: 0x06000115 RID: 277 RVA: 0x00006582 File Offset: 0x00004982
 private void willDisplayVideoEvent(string location)
 {
     if (Chartboost.willDisplayVideo != null)
     {
         Chartboost.willDisplayVideo(CBLocation.locationFromName(location));
     }
 }
 // Token: 0x06000112 RID: 274 RVA: 0x0000650F File Offset: 0x0000490F
 private void didCacheInPlayEvent(string location)
 {
     if (Chartboost.didCacheInPlay != null)
     {
         Chartboost.didCacheInPlay(CBLocation.locationFromName(location));
     }
 }
 // Token: 0x06000103 RID: 259 RVA: 0x00006214 File Offset: 0x00004614
 private void didDismissMoreAppsEvent(string location)
 {
     Chartboost.doUnityPause(false, false);
     if (Chartboost.didDismissMoreApps != null)
     {
         Chartboost.didDismissMoreApps(CBLocation.locationFromName(location));
     }
 }
 // Token: 0x06000108 RID: 264 RVA: 0x000062CD File Offset: 0x000046CD
 private void didDisplayMoreAppsEvent(string location)
 {
     Chartboost.doUnityPause(true, true);
     if (Chartboost.didDisplayMoreApps != null)
     {
         Chartboost.didDisplayMoreApps(CBLocation.locationFromName(location));
     }
 }
 // Token: 0x060000E3 RID: 227 RVA: 0x00005DDE File Offset: 0x000041DE
 public static void didPassAgeGate(bool pass)
 {
     if (Chartboost.showingAgeGate)
     {
         Chartboost.doShowAgeGate(false);
         CBExternal.didPassAgeGate(pass);
     }
 }
 // Token: 0x06000117 RID: 279 RVA: 0x0000660E File Offset: 0x00004A0E
 private static void doShowAgeGate(bool visible)
 {
     if (Chartboost.shouldPause)
     {
         Chartboost.doUnityPause(!visible, true);
     }
     Chartboost.showingAgeGate = visible;
 }
 /// <summary>
 /// Initialize the chart boost process .
 /// </summary>
 public void Init()
 {
     //implimenting Auto cache .
     Chartboost.setAutoCacheAds(AutoCache);
     //create chart boost
     Chartboost.CreateWithAppId("5aba8b5df7c1590bb81e831f", "ac5a8aec6f8222760cd0a01e0533d29cb19ab8e6");
     //Initialize chart boost
     Print("Is chart boost initialized " + Chartboost.isInitialized());
 }
        // Token: 0x06000109 RID: 265 RVA: 0x000062F0 File Offset: 0x000046F0
        private void didFailToRecordClickEvent(string dataString)
        {
            Hashtable    hashtable = (Hashtable)CBJSON.Deserialize(dataString);
            CBClickError arg       = Chartboost.clickErrorFromInt(hashtable["errorCode"]);

            if (Chartboost.didFailToRecordClick != null)
            {
                Chartboost.didFailToRecordClick(CBLocation.locationFromName(hashtable["location"] as string), arg);
            }
        }
        // Token: 0x06000113 RID: 275 RVA: 0x0000652C File Offset: 0x0000492C
        private void didFailToLoadInPlayEvent(string dataString)
        {
            Hashtable         hashtable = (Hashtable)CBJSON.Deserialize(dataString);
            CBImpressionError arg       = Chartboost.impressionErrorFromInt(hashtable["errorCode"]);

            if (Chartboost.didFailToLoadInPlay != null)
            {
                Chartboost.didFailToLoadInPlay(CBLocation.locationFromName(hashtable["location"] as string), arg);
            }
        }
 /// <summary>
 /// Show Reward Video.
 /// </summary>
 public static void ShowRewardVideo()
 {
     //if chart boost is initialized.
     if (Chartboost.isInitialized())
     {
         Chartboost.showRewardedVideo(CBLocation.Default);
     }
     else
     {
         Debug.Log("not yet initialized");
     }
 }
 // Token: 0x060000FC RID: 252 RVA: 0x000060C0 File Offset: 0x000044C0
 private void didDismissInterstitialEvent(string location)
 {
     Chartboost.doUnityPause(false, false);
     if (CBExternal.isWebViewEnabled())
     {
         Screen.orientation = ScreenOrientation.AutoRotation;
     }
     if (Chartboost.didDismissInterstitial != null)
     {
         Chartboost.didDismissInterstitial(CBLocation.locationFromName(location));
     }
 }
 // Token: 0x06000101 RID: 257 RVA: 0x00006189 File Offset: 0x00004589
 public void didDisplayInterstitialEvent(string location)
 {
     Chartboost.doUnityPause(true, true);
     if (CBExternal.isWebViewEnabled())
     {
         Screen.orientation = Screen.orientation;
     }
     if (Chartboost.didDisplayInterstitial != null)
     {
         Chartboost.didDisplayInterstitial(CBLocation.locationFromName(location));
     }
 }
 // Token: 0x06000111 RID: 273 RVA: 0x000064D8 File Offset: 0x000048D8
 private void didDisplayRewardedVideoEvent(string location)
 {
     Chartboost.doUnityPause(true, true);
     if (CBExternal.isWebViewEnabled())
     {
         Screen.orientation = Screen.orientation;
     }
     if (Chartboost.didDisplayRewardedVideo != null)
     {
         Chartboost.didDisplayRewardedVideo(CBLocation.locationFromName(location));
     }
 }
        /// <summary>
        /// Wait for Internet to appear.
        /// </summary>
        /// <returns></returns>
        private IEnumerator WaitForInternetToCome()
        {
            //when auto caching is off and no internet.
            while (Application.internetReachability == NetworkReachability.NotReachable && !AutoCache)
            {
                yield return(new WaitForSecondsRealtime(60f));

                Print("NETWORK NOT AVAILABLE.....");
            }

            Print("NETWORK  AVAILABLE...READY TO CACHE ADD..");
            Chartboost.cacheRewardedVideo(CBLocation.Default);
        }
        // Token: 0x0600010F RID: 271 RVA: 0x00006420 File Offset: 0x00004820
        private void shouldDisplayRewardedVideoEvent(string location)
        {
            bool flag = true;

            if (Chartboost.shouldDisplayRewardedVideo != null)
            {
                flag = Chartboost.shouldDisplayRewardedVideo(CBLocation.locationFromName(location));
            }
            CBExternal.chartBoostShouldDisplayRewardedVideoCallbackResult(flag);
            if (flag)
            {
                Chartboost.showRewardedVideo(CBLocation.locationFromName(location));
            }
        }
        // Token: 0x06000100 RID: 256 RVA: 0x00006148 File Offset: 0x00004548
        private void shouldDisplayInterstitialEvent(string location)
        {
            bool flag = true;

            if (Chartboost.shouldDisplayInterstitial != null)
            {
                flag = Chartboost.shouldDisplayInterstitial(CBLocation.locationFromName(location));
            }
            CBExternal.chartBoostShouldDisplayInterstitialCallbackResult(flag);
            if (flag)
            {
                Chartboost.showInterstitial(CBLocation.locationFromName(location));
            }
        }
Example #21
0
        private void shouldDisplayMoreAppsEvent(string location)
        {
            bool shouldDisplayMoreAppsResponse = true;

            if (shouldDisplayMoreApps != null)
            {
                shouldDisplayMoreAppsResponse = shouldDisplayMoreApps(CBLocation.locationFromName(location));
            }
            CBExternal.chartBoostShouldDisplayMoreAppsCallbackResult(shouldDisplayMoreAppsResponse);
            if (shouldDisplayMoreAppsResponse)
            {
                Chartboost.showMoreApps(CBLocation.locationFromName(location));
            }
        }
        // Token: 0x06000107 RID: 263 RVA: 0x0000628C File Offset: 0x0000468C
        private void shouldDisplayMoreAppsEvent(string location)
        {
            bool flag = true;

            if (Chartboost.shouldDisplayMoreApps != null)
            {
                flag = Chartboost.shouldDisplayMoreApps(CBLocation.locationFromName(location));
            }
            CBExternal.chartBoostShouldDisplayMoreAppsCallbackResult(flag);
            if (flag)
            {
                Chartboost.showMoreApps(CBLocation.locationFromName(location));
            }
        }
Example #23
0
        private void shouldDisplayInterstitialEvent(string location)
        {
            bool shouldDisplayInterstitialResponse = true;

            if (shouldDisplayInterstitial != null)
            {
                shouldDisplayInterstitialResponse = shouldDisplayInterstitial(CBLocation.locationFromName(location));
            }
            CBExternal.chartBoostShouldDisplayInterstitialCallbackResult(shouldDisplayInterstitialResponse);
            if (shouldDisplayInterstitialResponse)
            {
                Chartboost.showInterstitial(CBLocation.locationFromName(location));
            }
        }
Example #24
0
        private void shouldDisplayRewardedVideoEvent(string location)
        {
            bool shouldDisplayRewardedVideoResponse = true;

            if (shouldDisplayRewardedVideo != null)
            {
                shouldDisplayRewardedVideoResponse = shouldDisplayRewardedVideo(CBLocation.locationFromName(location));
            }

            CBExternal.chartBoostShouldDisplayRewardedVideoCallbackResult(shouldDisplayRewardedVideoResponse);
            if (shouldDisplayRewardedVideoResponse)
            {
                Chartboost.showRewardedVideo(CBLocation.locationFromName(location));
            }
        }
 // Token: 0x06000116 RID: 278 RVA: 0x000065A0 File Offset: 0x000049A0
 private static void doUnityPause(bool pause, bool setShouldPause)
 {
     Chartboost.shouldPause = setShouldPause;
     if (pause && !Chartboost.isPaused)
     {
         Chartboost.lastTimeScale = Time.timeScale;
         Time.timeScale           = 0f;
         Chartboost.isPaused      = true;
         Chartboost.disableUI(true);
     }
     else if (!pause && Chartboost.isPaused)
     {
         Time.timeScale      = Chartboost.lastTimeScale;
         Chartboost.isPaused = false;
         Chartboost.disableUI(false);
     }
 }
        // Token: 0x06000110 RID: 272 RVA: 0x00006464 File Offset: 0x00004864
        private void didCompleteRewardedVideoEvent(string dataString)
        {
            Hashtable hashtable = (Hashtable)CBJSON.Deserialize(dataString);
            int       arg;

            try
            {
                arg = Convert.ToInt32(hashtable["reward"]);
            }
            catch
            {
                arg = 0;
            }
            if (Chartboost.didCompleteRewardedVideo != null)
            {
                Chartboost.didCompleteRewardedVideo(CBLocation.locationFromName(hashtable["location"] as string), arg);
            }
        }
Example #27
0
		void Awake() {
			// Limit the number of instances to one
			if(instance == null) {
				instance = this;
				CBExternal.init();
				CBExternal.setGameObjectName(gameObject.name);

				DontDestroyOnLoad(gameObject);

				#if UNITY_ANDROID
     				windowRect = new Rect (0, 0, Screen.width, Screen.height);
     			#endif
     			Chartboost.showingAgeGate = false;
			}
			else {
				// duplicate
				Destroy(gameObject);
			}
		}
Example #28
0
		void OnDestroy() {
			if(this == instance)
			{
				instance = null;
				CBExternal.destroy();
			}
		}
        public void SetupDelegatesForRewardVideo()
        {
            //CALLBACK 1.

            //If chart boost is initialized successfully then we will start a call for Caching else we will request for initialization.
            Chartboost.didInitialize += b =>
            {
                //If chart boost is initialized .
                if (b)
                {
                    //If autocache is deactivated .
                    //We have to handle the cache functionality .
                    if (!AutoCache)
                    {
                        //Start  for Caching .
                        Chartboost.cacheRewardedVideo(CBLocation.Default);
                    }
                }
                else
                {
                    //create the chart boost .
                    Chartboost.Create();
                    //print charboost is initiated.
                    Print("Creating chart boost");

                    /*
                     *      // Sample to create Chartboost gameobject from code overriding editor AppId and AppSignature
                     *      // Remove the Chartboost gameobject from the sample first
                     #if UNITY_IPHONE
                     *      Chartboost.CreateWithAppId("4f21c409cd1cb2fb7000001b", "92e2de2fd7070327bdeb54c15a5295309c6fcd2d");
                     #elif UNITY_ANDROID
                     *      Chartboost.CreateWithAppId("4f7b433509b6025804000002", "dd2d41b69ac01b80f443f5b6cf06096d457f82bd");
                     #endif
                     */
                }
            };
            //CALL bACK 2

            Chartboost.didFailToLoadRewardedVideo += (CBLocation location, CBImpressionError error) =>
            {
                Print("Failed to load the reward video");
                Print("Location", location);
                Print("Error" + error);
                //if the error is internal we will ignore the error.
                switch (error)
                {
                case CBImpressionError.Internal:
                    Print("ERROR IS INTERNAL UNABLE TO HANDLE THIS");
                    break;

                case CBImpressionError.InternetUnavailable:
                {
                    Print("No INTERNET IS AVAILABLE .");
                    var noInternetIenumerator = WaitForInternetToCome();
                    StartCoroutine(noInternetIenumerator);
                    return;
                }

                case CBImpressionError.TooManyConnections:
                    Print("SO MANY REQUEST RECEIVED WITHIN A SHORT PERION OF TIME");
                    break;

                case CBImpressionError.WrongOrientation:
                    Print("NOT IN PROPER ORIENTATION");
                    break;

                case CBImpressionError.FirstSessionInterstitialsDisabled:
                    Print("FIRST SESSION FOR INTERSTITIAL IN DIABLED");
                    break;

                case CBImpressionError.NetworkFailure:
                {
                    Print("NETWORK FAIlURE");
                    var noInternetIenumerator = WaitForInternetToCome();
                    StartCoroutine(noInternetIenumerator);
                    return;
                }

                case CBImpressionError.NoAdFound:
                    Print("NO AD FOUND FOR YOU");
                    break;

                case CBImpressionError.SessionNotStarted:
                    Print("NOT A VALID SESSION ");
                    break;

                case CBImpressionError.ImpressionAlreadyVisible:
                    Print("YOU ARE WATCHING THE VIDEO");
                    return;

                case CBImpressionError.NoHostActivity:
                    Print("NO HOST ACTIVE");
                    return;

                case CBImpressionError.UserCancellation:
                    Print("F*****G USER CANCELL MY VIDEO");
                    return;

                case CBImpressionError.InvalidLocation:
                    Print("CHECK YOUR LOCATION ");
                    return;

                case CBImpressionError.VideoUnAvailable:
                    Print("VIDEO NOT AVAILABLE IN CACHE SO I AM STARTING CACHING ONE MORE TIME");
                    break;

                case CBImpressionError.VideoIdMissing:
                    Print("VIDEO URL IS NOT PROPER");
                    break;

                case CBImpressionError.ErrorPlayingVideo:
                    Print("ERROR IN PLAYING VIDEO");
                    break;

                case CBImpressionError.InvalidResponse:
                    Print("INVALID RESPONCE");
                    return;

                case CBImpressionError.AssetsDownloadFailure:
                    Print("ASSET MISSING");
                    break;

                case CBImpressionError.ErrorCreatingView:
                    Print("ERROR IN MAKING A VIEW");
                    break;

                case CBImpressionError.ErrorDisplayingView:
                    Print("ERROR IN SHOWING A VIEW");
                    break;

                case CBImpressionError.PrefetchingIncomplete:
                    Print("ERROR IN PREFETCHING");
                    break;

                default:
                    throw new ArgumentOutOfRangeException("error", error, null);
                }

                //Start  for Caching when auto caching is off
                if (!AutoCache)
                {
                    Chartboost.cacheRewardedVideo(CBLocation.Default);
                }
                //Reward video is not avilable.
                _isRewardVideoAvailble = false;
            };
            //CALL bACK 3

            Chartboost.didDismissRewardedVideo += (CBLocation location) =>
            {
                Print("DISSMISS REWARD VIDEO");
                Print("Location Where Video is cancelled" + location);

                //Prompt user
                //You missed 20 Purple Heart .
            };
            //CALL BACK 4

            Chartboost.didCloseRewardedVideo += (CBLocation location) =>
            {
                Print("CLOSED REWARD VIDEO");
                Print("Location Where Video is cancelled" + location);
                //When reward video is cloed give a call for next time to cache video.
                if (!AutoCache)
                {
                    Chartboost.cacheRewardedVideo(CBLocation.Default);
                }
            };
            //CALL BACK 5

            Chartboost.didClickRewardedVideo += (CBLocation location) =>
            {
                Print("CLICKED REWARD VIDEO");
                Print("Location Where Video is cancelled" + location);
                //Prompt user
                //are you want to leave the game.
            };
            //CALL BACK 6

            Chartboost.didCacheRewardedVideo += (CBLocation location) =>
            {
                Print("REWARD VIDEO CACHED");
                Print("Location Whete Video is cancelled" + location);
                _isRewardVideoAvailble = true;
            };
            //CALL BACK 7

            Chartboost.shouldDisplayRewardedVideo += ShouldDisplayRewardedVideo;
            //CALL BACK 8

            Chartboost.didCompleteRewardedVideo += (CBLocation location, int reward) =>
            {
                Print("Give some gift to user");
                Print("GIFT AMOUNT" + reward);
                //provide gift to the user .
            };
            //CALL BACK 9

            Chartboost.willDisplayVideo += (CBLocation location) =>
            {
                Print("REWARD VIDEO WILL BE DISPLAYED ");
                Print("Location Whete Video is cancelled" + location);
            };
        }
Example #30
0
		void Awake() {
			// Limit the number of instances to one
			if(instance == null) {
				instance = this;
				CBExternal.init();
				CBExternal.setGameObjectName(gameObject.name);

				DontDestroyOnLoad(gameObject);

     			Chartboost.showingAgeGate = false;
			}
			else {
				// duplicate
				Destroy(gameObject);
			}
		}
Example #31
0
		public static Chartboost Create() {
			if( instance == null ) {
				GameObject singleton = new GameObject("Chartboost");
				instance = singleton.AddComponent<Chartboost>();
			}
			else {
				Debug.LogWarning("CHARTBOOST: Chartboost instance already exists. Create() ignored");
			}
			return instance;
		}
Example #32
0
        void Awake()
        {
            // Limit the number of instances to one
            if(instance == null) {
                instance = this;
                CBExternal.init();
                CBExternal.setGameObjectName(gameObject.name);

                DontDestroyOnLoad(gameObject);

                #if UNITY_ANDROID
             				windowRect = new Rect (0, 0, Screen.width, Screen.height);
                    transparentTexture = new Texture2D(1, 1);
                    transparentTexture.SetPixel(0, 0, Color.clear);
                    transparentTexture.Apply();
                    transparent = new GUIStyle();
                    transparent.normal.background = transparentTexture;

             			#endif
             			Chartboost.showingAgeGate = false;
            }
            else {
                // duplicate
                Destroy(gameObject);
            }
        }
Example #33
0
		void OnDisable() {
			// Shut down the Chartboost plugin
			#if UNITY_ANDROID
			if(this == instance)
			{
				instance = null;
				CBExternal.destroy();
			}
			#endif
		}
Example #34
0
		public static Chartboost Create() {
			if( instance == null ) {
				GameObject singleton = new GameObject();
				instance = singleton.AddComponent<Chartboost>();
				singleton.name = "Chartboost";
			}
			return instance;
		}
 // Token: 0x060000F2 RID: 242 RVA: 0x00005EBB File Offset: 0x000042BB
 public static Chartboost CreateWithAppId(string appId, string appSignature)
 {
     CBSettings.setAppId(appId, appSignature);
     return(Chartboost.Create());
 }