Пример #1
0
        public override void OnInspector()
        {
            using (KGGUIHelper.DisableForSealed())
            {
                KGSharedData.instance.google.clientID = EditorGUILayout.TextField("iOS Client ID", KGSharedData.instance.google.clientID);

                var clientId = KGSharedData.instance.google.clientID;
                if (string.IsNullOrEmpty(clientId))
                {
                    clientId = "CLIENT_ID";
                }

                bool old = GUI.enabled;
                GUI.enabled = false;
                KGSharedData.instance.google.urlScheme = EditorGUILayout.TextField("iOS URL Scheme", "com.googleusercontent.apps." + clientId.Split('.')[0]);
                GUI.enabled = old;

                KGSharedData.instance.google.webappClientId = EditorGUILayout.TextField("Webapp Client ID", KGSharedData.instance.google.webappClientId);

                var webappClientId = KGSharedData.instance.google.webappClientId;
                if (string.IsNullOrEmpty(webappClientId))
                {
                    webappClientId = "WEB_APP_CLIENT_ID";
                }

                old         = GUI.enabled;
                GUI.enabled = false;
                EditorGUILayout.TextField("App ID", webappClientId.Split('-')[0]);
                GUI.enabled = old;
            }

            KGPermissionList.ShowPermissionList("Permissions", KGSharedData.instance.google.permissions, ref fold);

            EditorGUILayout.Space();
        }
Пример #2
0
        public override void OnInspector()
        {
            string appKey   = EditorGUILayout.TextField("App Key", KGSharedData.instance.facebook.appKey);
            string appTitle = EditorGUILayout.TextField("App Title", KGSharedData.instance.facebook.appTitle);

            if (KGSharedData.instance != null && KGSharedData.instance.useFacebook == true)
            {
                if (appKey != KGSharedData.instance.facebook.appKey)
                {
                    KGSharedData.instance.facebook.appKey = appKey;
                }

                if (appTitle != KGSharedData.instance.facebook.appTitle)
                {
                    KGSharedData.instance.facebook.appTitle = appTitle;
                }
            }

            var lastEnabled = GUI.enabled;

            GUI.enabled = false;
            EditorGUILayout.TextField("URL Scheme", "fb" + KGSharedData.instance.facebook.appKey);
            GUI.enabled = lastEnabled;

            KGPermissionList.ShowPermissionList("ReadPermissions", KGSharedData.instance.facebook.permissions, ref fold);

            //            Type fbType = null;
            //            var assemblies = AppDomain.CurrentDomain.GetAssemblies();
            //            foreach (var asm in assemblies)
            //            {
            //                fbType = asm.GetType("Facebook.Unity.FacebookSettings");
            //                if (fbType != null) break;
            //            }
            //
            //#if KG_ENABLE_FB_UNITY
            GUILayout.BeginHorizontal();
            //            GUILayout.FlexibleSpace();
            if (KGSharedData.instance.useFacebook == true && GUILayout.Button("FB SDK Settings"))
            {
                EditorWindow.focusedWindow.Close();
                EditorApplication.ExecuteMenuItem("Facebook/Edit Settings");
            }

            GUILayout.EndHorizontal();
            //
            //            // FB 설정과 지니 설정을 동기화
            //            if (GUI.changed && fbType != null)
            //            {
            //                fbType.GetProperty("AppLabels").SetValue(
            //                    null, new List<string>() { KGSharedData.instance.facebook.appTitle }, new object[] { });
            //                fbType.GetProperty("AppIds").SetValue(
            //                    null, new List<string>() { KGSharedData.instance.facebook.appKey }, new object[] { });
            //                fbType.InvokeMember(
            //                    "SettingsChanged",
            //                    BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.InvokeMethod,
            //                    Type.DefaultBinder, null, new object[] { });
            //            }
            //#endif
            //
            //            GUILayout.BeginHorizontal();
            //            EditorGUILayout.LabelField("" /* NativeLibrary */);
            //            GUILayout.FlexibleSpace();
            //
            //            if (fbType == null)
            //                ; // EditorGUILayout.LabelField("Not Found");
            //            else
            //            {
            //                var fbVerType = fbType.Assembly.GetType("Facebook.Unity.FacebookSdkVersion");
            //                EditorGUILayout.LabelField("FB Unity SDK : v." + fbVerType.GetProperty("Build").GetValue(null, new object[] { }).ToString());
            //            }
            //
            //            GUILayout.EndHorizontal();
        }