示例#1
0
		public static void I_SyncWithNative() {
			#if !UNITY_EDITOR
			JSONObject json = null;
			#if UNITY_ANDROID
			AndroidJNI.PushLocalFrame(100);
			using(AndroidJavaClass jniGrowInsightsUnity = new AndroidJavaClass("com.soomla.highway.unity.GrowInsights")) {
				string userInsightsJSON = jniGrowInsightsUnity.CallStatic<string>("getUserInsights");
				json = new JSONObject(userInsightsJSON);
			}
			AndroidJNI.PopLocalFrame(IntPtr.Zero);
			
			#elif UNITY_IOS
			string userInsightsJSON = "{}";
			growInsights_getUserInsights(out userInsightsJSON);
			json = new JSONObject(userInsightsJSON);
			#endif
			if (json != null) {
				UserInsights = new UserInsights(json);
			}
			#endif
		}
 public static void I_SyncWithNative()
 {
                 #if !UNITY_EDITOR
     JSONObject json = null;
                 #if UNITY_ANDROID
     AndroidJNI.PushLocalFrame(100);
     using (AndroidJavaClass jniGrowInsightsUnity = new AndroidJavaClass("com.soomla.highway.unity.GrowInsights")) {
         string userInsightsJSON = jniGrowInsightsUnity.CallStatic <string>("getUserInsights");
         json = new JSONObject(userInsightsJSON);
     }
     AndroidJNI.PopLocalFrame(IntPtr.Zero);
                 #elif UNITY_IOS
     string userInsightsJSON = "{}";
     growInsights_getUserInsights(out userInsightsJSON);
     json = new JSONObject(userInsightsJSON);
                 #endif
     if (json != null)
     {
         UserInsights = new UserInsights(json);
     }
                 #endif
 }