void Awake() { print("ShareSDK Awake"); Type type = devInfo.GetType(); Hashtable platformConfigs = new Hashtable(); FieldInfo[] devInfoFields = type.GetFields(); foreach (FieldInfo devInfoField in devInfoFields) { DevInfo info = (DevInfo) devInfoField.GetValue(devInfo); int platformId = (int) info.GetType().GetField("type").GetValue(info); FieldInfo[] fields = info.GetType().GetFields(); Hashtable table = new Hashtable(); foreach (FieldInfo field in fields) { if ("type".EndsWith(field.Name)) { continue; } else if ("Enable".EndsWith(field.Name)) { table.Add(field.Name, Convert.ToString(field.GetValue(info)).ToLower()); } else { table.Add(field.Name, Convert.ToString(field.GetValue(info))); } } platformConfigs.Add(platformId, table); } string appKey = (string)appkey.GetType().GetField("appKey").GetValue(appkey); #if UNITY_ANDROID shareSDKUtils = new AndroidUtils(gameObject); #elif UNITY_IPHONE shareSDKUtils = new iOSUtils(gameObject); #endif shareSDKUtils.RigisterAppAndSetPlatformConfig(appKey, platformConfigs); }
void Awake() { print("ShareSDK Awake"); Type type = devInfo.GetType(); Hashtable platformConfigs = new Hashtable(); FieldInfo[] devInfoFields = type.GetFields(); foreach (FieldInfo devInfoField in devInfoFields) { DevInfo info = (DevInfo)devInfoField.GetValue(devInfo); int platformId = (int)info.GetType().GetField("type").GetValue(info); FieldInfo[] fields = info.GetType().GetFields(); Hashtable table = new Hashtable(); foreach (FieldInfo field in fields) { if ("type".EndsWith(field.Name)) { continue; } else if ("Enable".EndsWith(field.Name)) { table.Add(field.Name, Convert.ToString(field.GetValue(info)).ToLower()); } else { table.Add(field.Name, Convert.ToString(field.GetValue(info))); } } platformConfigs.Add(platformId, table); } string appKey = (string)appkey.GetType().GetField("appKey").GetValue(appkey); #if UNITY_ANDROID shareSDKUtils = new AndroidUtils(gameObject); #elif UNITY_IPHONE shareSDKUtils = new iOSUtils(gameObject); #endif shareSDKUtils.RigisterAppAndSetPlatformConfig(appKey, platformConfigs); }
/// <summary> /// Sets the platform config. /// </summary> /// <param name='type'> /// Type. /// </param> /// <param name='configInfo'> /// Config info. /// </param> public void RigisterAppAndSetPlatformConfig(String appKey, Hashtable configInfo) { // if you don't add ShareSDK.xml in your assets folder, use the following line shareSDKUtils.RigisterAppAndSetPlatformConfig(appKey, configInfo); }
void Awake() { print("ShareSDK Awake"); Type type = devInfo.GetType(); Hashtable platformConfigs = new Hashtable(); FieldInfo[] devInfoFields = type.GetFields(); foreach (FieldInfo devInfoField in devInfoFields) { DevInfo info = (DevInfo) devInfoField.GetValue(devInfo); int platformId = (int) info.GetType().GetField("type").GetValue(info); FieldInfo[] fields = info.GetType().GetFields(); Hashtable table = new Hashtable(); foreach (FieldInfo field in fields) { table.Add(field.Name, field.GetValue(info)); } platformConfigs.Add(platformId, table); } #if UNITY_ANDROID shareSDKUtils = new AndroidUtils(gameObject); #elif UNITY_IPHONE shareSDKUtils = new iOSUtils(gameObject); #endif appkey = new AppKey (); shareSDKUtils.RigisterAppAndSetPlatformConfig(appkey.appKey, platformConfigs); }