public override void Init() { PRODUCT_IDENTIFIERS[0] = GOLD_200; PRODUCT_IDENTIFIERS[1] = GOLD_500; PRODUCT_IDENTIFIERS[2] = GOLD_4000; Application.targetFrameRate = 45; GameObject gcm; GameObject skm; GameObject etcm; GameObject etcl; GameObject cbm; if (GameObject.Find("GameCenterManager") == null && GameObject.Find("GameCenterManager(Clone)") == null) { gcm = (GameObject)Instantiate(Resources.Load(PRIME31_DIRECTORY + "GameCenterManager")); } if (GameObject.Find("StoreKitManager") == null && GameObject.Find("StoreKitManager(Clone)") == null) { skm = (GameObject)Instantiate(Resources.Load(PRIME31_DIRECTORY + "StoreKitManager")); } if (GameObject.Find("EtceteraManager") == null && GameObject.Find("EtceteraManager(Clone)") == null) { etcm = (GameObject)Instantiate(Resources.Load(PRIME31_DIRECTORY + "EtceteraManager")); } if (GameObject.Find("EtceteraEventListener") == null && GameObject.Find("EtceteraEventListener(Clone)") == null) { etcl = (GameObject)Instantiate(Resources.Load(PRIME31_DIRECTORY + "EtceteraEventListener")); } if (GameObject.Find("ChartBoostManager") == null && GameObject.Find("ChartBoostManager(Clone)") == null) { cbm = (GameObject)Instantiate(Resources.Load(PRIME31_DIRECTORY + "ChartBoostManager")); } #if UNITY_IPHONE ChartBoostBinding.init(CHARTBOOST_APPID, CHARTBOOST_SIGNATURE); StoreKitBinding.requestProductData(PRODUCT_IDENTIFIERS); if (GameCenterBinding.isGameCenterAvailable()) { GameCenterBinding.authenticateLocalPlayer(); } #endif }
// Use this for initialization void Awake() { //Set Static flags ChartBoostActiveStaticFlag = ChartBoostActiveFlag; RevMobActiveStaticFlag = RevMobActiveFlag; AdMobActiveStaticFlag = AdMobActiveFlag; PlayHavenActiveStaticFlag = PlayHavenActiveFlag; IAdsActiveStaticFlag = IAdsActiveFlag; TapJoyActiveStaticFlag = TapJoyActiveFlag; VungleActiveStaticFlag = VungleActiveFlag; FlurryActiveStaticFlag = FlurryActiveFlag; AppLovinStaticFlag = AppLovinFlag; //Initialize ChartBoost if (ChartBoostActiveFlag) { ChartBoostBinding.init(ChartBoostID, ChartBoostSIG, false); ChartBoostBinding.cacheInterstitial(null); ChartBoostBinding.cacheMoreApps(); } //Initialize RevMob if (RevMobActiveFlag) { REVMOB_APP_IDS.Add("IOS", RevMobID); revMobSession = RevMob.Start(REVMOB_APP_IDS); } //Initialize Admob if (AdMobActiveFlag) { AdMobBinding.init(AdMobID); } //Initialize Playhaven if (PlayHavenActiveFlag) { gameObject.SendMessage("OpenNotification"); } //Initialize iAds if (IAdsActiveFlag) { } //Initialize TapJoy if (TapJoyActiveFlag) { TapjoyPluginIOS.RequestTapjoyConnect(TapJoyID, TapJoySecretKey); Debug.Log("Tapjoy integrated"); } //Initialize Vungle if (VungleActiveFlag) { VungleBinding.startWithAppId(VungleID); } //Initialize Flurry if (FlurryActiveFlag) { FlurryBinding.startSession(FlurryID); //FlurryBinding.logEvent("Testing session started", false); } if (AppLovinFlag) { AppLovin.SetSdkKey(AppLovinID); AppLovin.InitializeSdk(); } }
void OnGUI() { float yPos = 5.0f; float xPos = 5.0f; float width = (Screen.width >= 960 || Screen.height >= 960) ? 320 : 160; float height = (Screen.width >= 960 || Screen.height >= 960) ? 80 : 40; float heightPlus = height + 10.0f; if (GUI.Button(new Rect(xPos, yPos, width, height), "Init")) { ChartBoostBinding.init("YOUR_APP_ID", "YOUR_APP_SIGNATURE"); } if (GUI.Button(new Rect(xPos, yPos += heightPlus, width, height), "Cache Interstitial")) { ChartBoostBinding.cacheInterstitial("default"); } if (GUI.Button(new Rect(xPos, yPos += heightPlus, width, height), "Is Interstitial Cached?")) { Debug.Log("is cached: " + ChartBoostBinding.hasCachedInterstitial("default")); } if (GUI.Button(new Rect(xPos, yPos += heightPlus, width, height), "Show Interstitial")) { ChartBoostBinding.showInterstitial("default"); } if (GUI.Button(new Rect(xPos, yPos += heightPlus, width, height), "Cache More Apps")) { ChartBoostBinding.cacheMoreApps(); } if (GUI.Button(new Rect(xPos, yPos += heightPlus, width, height), "Show More Apps")) { ChartBoostBinding.showMoreApps(); } xPos = Screen.width - width - 5.0f; yPos = 5.0f; if (GUI.Button(new Rect(xPos, yPos, width, height), "Track Event")) { ChartBoostBinding.trackEvent("some_event"); } if (GUI.Button(new Rect(xPos, yPos += heightPlus, width, height), "Track Event with Metadata")) { var dict = new Dictionary <string, string>(); dict.Add("key", "theValue"); ChartBoostBinding.trackEventWithMetadata("some_event_with_data", dict); } if (GUI.Button(new Rect(xPos, yPos += heightPlus, width, height), "Track Event with Value")) { ChartBoostBinding.trackEventWithValue("event_with_value", 123); } if (GUI.Button(new Rect(xPos, yPos += heightPlus, width, height), "Track Event with Value and Metadata")) { var dict = new Dictionary <string, string>(); dict.Add("key", "theValue"); ChartBoostBinding.trackEventWithValueAndMetadata("event_with_value_and_data", 9809823, dict); } }