コード例 #1
0
		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);
		}
コード例 #2
0
ファイル: ShareSDK.cs プロジェクト: liamzhu/Bridge
        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);
        }
コード例 #3
0
 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);
 }