Beispiel #1
0
        void Settings()
        {
            var settingsIcon = EditorAssetDatabase.GetTextureAtPath(XCodeWindowSkin.IconsPath + "isdSettings.png");

            using (new IMGUIWindowBlockWithIndent(new GUIContent("Settings", settingsIcon)))
            {
                var isEnabled = XCodeProjectSettings.PostProcessEnabled;
                EditorGUI.BeginChangeCheck();
                isEnabled = IMGUILayout.ToggleFiled("Build PostProcess", isEnabled, IMGUIToggleStyle.ToggleType.YesNo);
                if (EditorGUI.EndChangeCheck())
                {
                    EditorUtility.DisplayDialog("Configuration", "Changes will be applide after scripts re-recompilation is completed", "Okay");
                    if (isEnabled)
                    {
                        EditorDefines.RemoveCompileDefine("ISD_DISABLED", BuildTarget.iOS);
                    }
                    else
                    {
                        EditorDefines.AddCompileDefine("ISD_DISABLED", BuildTarget.iOS);
                    }
                }

                if (!XCodeProjectSettings.PostProcessEnabled)
                {
                    EditorGUILayout.HelpBox("Build PostProcess is curreently disabled. " +
                                            "The XCode project will not be modifayed.", MessageType.Error);
                }
            }
        }
Beispiel #2
0
        public override void OnGUI()
        {
#if (UNITY_IOS || UNITY_TVOS)
            Settings();
#else
            EditorGUILayout.HelpBox("XCode Build Post-Process isn't avaliable on current platfrom", MessageType.Error);
#endif

            var buildSettingsIcon = EditorAssetDatabase.GetTextureAtPath(XCodeWindowSkin.IconsPath + "BuildSettings.png");
            using (new IMGUIWindowBlockWithIndent(new GUIContent("Build Properties", buildSettingsIcon)))
            {
                foreach (var property in XCodeProjectSettings.Instance.BuildProperties)
                {
                    property.Value = IMGUILayout.StringValuePopup(property.Name, property.Value, property.Options);
                }
                EditorGUILayout.Space();
            }

            Frameworks();
            DrawEmbeddedBlock();

            BuildFlags();
            Languages();

            CopyFilestoXCodeBuildPhasee();
            ShellScriptsBuildPhasee();

            Entitlements();
        }
Beispiel #3
0
        static void DrawEmbeddedBlock()
        {
            var libraries_icon = EditorAssetDatabase.GetTextureAtPath(XCodeWindowSkin.IconsPath + "libraries.png");

            using (new IMGUIWindowBlockWithIndent(new GUIContent("Embedded Binaries", libraries_icon)))
            {
                IMGUILayout.ReorderablList(XCodeProjectSettings.Instance.EmbededFrameworks,
                                           (XCodeEmbedFramework framework) =>
                {
                    return(framework.FileName);
                },
                                           (XCodeEmbedFramework freamwork) =>
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("Asset: ");
                    freamwork.Asset = EditorGUILayout.ObjectField(freamwork.Asset, typeof(UnityEngine.Object), false);
                    EditorGUILayout.EndHorizontal();
                },
                                           () =>
                {
                    XCodeProjectSettings.Instance.EmbededFrameworks.Add(new XCodeEmbedFramework());
                }
                                           );
            }
        }
Beispiel #4
0
        public void Languages()
        {
            EditorGUI.BeginChangeCheck();

            var languages_icon = EditorAssetDatabase.GetTextureAtPath(XCodeWindowSkin.IconsPath + "languages.png");

            using (new IMGUIWindowBlockWithIndent(new GUIContent("Languages", languages_icon)))
            {
                IMGUILayout.ReorderablList(XCodeProjectSettings.Instance.Languages,
                                           (SA_ISOLanguage lang) =>
                {
                    return(lang.Code.ToUpper() + "     (" + lang.Name + ")");
                }
                                           );

                EditorGUILayout.BeginHorizontal();
                s_newLangindex = EditorGUILayout.Popup(s_newLangindex, SA_LanguagesUtil.ISOLanguagesList.Names.ToArray());
                if (GUILayout.Button("Add Language", EditorStyles.miniButton, GUILayout.Width(100)))
                {
                    var lang = SA_LanguagesUtil.ISOLanguagesList.Languages[s_newLangindex];
                    XCodeProjectSettings.Instance.Languages.Add(lang);
                }

                EditorGUILayout.EndHorizontal();
            }

            if (EditorGUI.EndChangeCheck())
            {
                if (XCodeProjectSettings.Instance.Languages.Count == 0)
                {
                    XCodeProject.RemoveInfoPlistKey(XCodeProjectSettings.CfLocalizationsPlistKey);
                }
            }
        }
Beispiel #5
0
        void CopyFilestoXCodeBuildPhasee()
        {
            var folder = EditorAssetDatabase.GetTextureAtPath(XCodeWindowSkin.IconsPath + "folder.png");

            using (new IMGUIWindowBlockWithIndent(new GUIContent("Copy Files to XCode Build Phasee", folder)))
            {
                IMGUILayout.ReorderablList(XCodeProjectSettings.Instance.Files,
                                           (XCodeAsset file) =>
                {
                    return(file.XCodeRelativePath);
                },
                                           (XCodeAsset file) =>
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("Asset: ");
                    file.Asset = EditorGUILayout.ObjectField(file.Asset, typeof(UnityEngine.Object), false);
                    EditorGUILayout.EndHorizontal();

                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("XCode Path:");
                    file.XCodePath = EditorGUILayout.TextField(file.XCodePath);
                    EditorGUILayout.EndHorizontal();
                },
                                           () =>
                {
                    XCodeProjectSettings.Instance.Files.Add(new XCodeAsset());
                }
                                           );

                EditorGUILayout.Space();
            }
        }
        void DrawConfiguration(int index)
        {
            var conf = BuildConfigurationSettings.Instance.BuildConfigurations[index];

            using (new IMGUIBlockWithIndent(new GUIContent("Settings")))
            {
                conf.Name = IMGUILayout.TextField("Configuration Name:", conf.Name);
                conf.DefaultScenesFirst = IMGUILayout.ToggleFiled("Default Scenes First", conf.DefaultScenesFirst, IMGUIToggleStyle.ToggleType.YesNo);

                GUILayout.Space(EditorGUIUtility.singleLineHeight);
                using (new IMGUIBeginHorizontal())
                {
                    GUILayout.FlexibleSpace();

                    if (BuildConfigurationSettings.Instance.ActiveConfigurationIndex == index)
                    {
                        GUI.enabled = false;
                    }

                    bool active = GUILayout.Button("Set As Active", GUILayout.Width(100));
                    if (active)
                    {
                        BuildConfigurationSettings.Instance.ActiveConfigurationIndex = index;
                        UpdateActiveConfUI();
                    }

                    GUI.enabled = true;

                    bool remove = GUILayout.Button("Remove", GUILayout.Width(100));
                    if (remove)
                    {
                        BuildConfigurationSettings.Instance.BuildConfigurations.Remove(conf);
                        OnAwake();
                        GUIUtility.ExitGUI();
                        return;
                    }
                }
            }

            if (conf.DefaultScenesFirst)
            {
                DrawDefaultScenes(conf);
                DrawPlatforms(conf);
            }
            else
            {
                DrawPlatforms(conf);
                DrawDefaultScenes(conf);
            }
        }
Beispiel #7
0
        public void OnDispose()
        {
            mPackageKitWindow = null;
            mSplitView        = null;

            mDisposableList.Dispose();
            mDisposableList = null;

            mCategoriesSelectorView = null;

            mLeftLayout.Dispose();
            mLeftLayout = null;

            mRightLayout.Dispose();
            mRightLayout = null;

            mMarkdownViewer = null;
        }
Beispiel #8
0
        public void BuildFlags()
        {
            var linkerFlags = EditorAssetDatabase.GetTextureAtPath(XCodeWindowSkin.IconsPath + "linkerFlags.png");

            using (new IMGUIWindowBlockWithIndent(new GUIContent("Linker & Compiler Flags", linkerFlags)))
            {
                IMGUILayout.ReorderablList(XCodeProjectSettings.Instance.Flags,
                                           (XCodeProjectFlag flag) =>
                {
                    if (flag.Type.Equals(XCodeFlagType.CompilerFlag))
                    {
                        return(flag.Name + "     (Compiler)");
                    }
                    else
                    {
                        return(flag.Name + "     (Linker)");
                    }
                },
                                           (XCodeProjectFlag flag) =>
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("Full Name:", GUILayout.Width(100));
                    flag.Name = EditorGUILayout.TextField(flag.Name, GUILayout.ExpandWidth(true));
                    EditorGUILayout.EndHorizontal();

                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("Type:", GUILayout.Width(100));

                    //flag.Type     = EditorGUILayout.TextField(flag.Type, GUILayout.ExpandWidth(true));
                    flag.Type = (XCodeFlagType)EditorGUILayout.EnumPopup(flag.Type);
                    EditorGUILayout.EndHorizontal();
                },
                                           () =>
                {
                    var newFlag  = new XCodeProjectFlag();
                    newFlag.Name = "New Flag";
                    XCodeProjectSettings.Instance.Flags.Add(newFlag);
                }
                                           );
            }

            EditorGUILayout.Space();
        }
        public override void OnGUI()
        {
            IMGUILayout.Header("PLIST VALUES");

            foreach (var plistKey in XCodeProjectSettings.Instance.PlistVariables)
            {
                EditorGUILayout.BeginVertical(GUI.skin.box);
                DrawPlistVariable(plistKey, plistKey, XCodeProjectSettings.Instance.PlistVariables);
                EditorGUILayout.EndVertical();

                if (!XCodeProjectSettings.Instance.PlistVariables.Contains(plistKey))
                {
                    return;
                }
            }

            EditorGUILayout.Space();

            EditorGUILayout.BeginVertical(GUI.skin.box);
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("New Variable Name");
            s_NewPlistValueName = EditorGUILayout.TextField(s_NewPlistValueName);
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.Space();
            if (GUILayout.Button("Add", GUILayout.Width(100)))
            {
                if (s_NewPlistValueName.Length > 0)
                {
                    var v = new InfoPlistKey();
                    v.Name = s_NewPlistValueName;
                    XCodeProject.SetInfoPlistKey(v);
                }

                s_NewPlistValueName = string.Empty;
            }

            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();
            EditorGUILayout.EndVertical();
        }
Beispiel #10
0
        void ShellScriptsBuildPhasee()
        {
            var plistVariables_icon = EditorAssetDatabase.GetTextureAtPath(XCodeWindowSkin.IconsPath + "plistVariables.png");

            using (new IMGUIWindowBlockWithIndent(new GUIContent("Shell Scripts Build Phasee", plistVariables_icon)))
            {
                IMGUILayout.ReorderablList(XCodeProjectSettings.Instance.ShellScripts,
                                           (XCodeShellScript script) =>
                {
                    return(script.Name);
                },
                                           (XCodeShellScript script) =>
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("Name: ");
                    script.Name = EditorGUILayout.TextField(script.Name);
                    EditorGUILayout.EndHorizontal();

                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("Shell: ");
                    script.Shell = EditorGUILayout.TextField(script.Shell);
                    EditorGUILayout.EndHorizontal();

                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("Script");
                    script.Script = EditorGUILayout.TextField(script.Script);
                    EditorGUILayout.EndHorizontal();
                },
                                           () =>
                {
                    XCodeProjectSettings.Instance.ShellScripts.Add(new XCodeShellScript());
                }
                                           );
                EditorGUILayout.Space();
            }
        }
 public static T Parent <T>(this T view, IMGUILayout parent) where T : IMGUIView
 {
     parent.AddChild(view);
     return(view);
 }
Beispiel #12
0
        void Entitlements()
        {
            var entitlements = EditorAssetDatabase.GetTextureAtPath(XCodeWindowSkin.IconsPath + "entitlements.png");

            using (new IMGUIWindowBlockWithIndent(new GUIContent("Entitlements", entitlements)))
            {
                EditorGUILayout.HelpBox("Entitlements confer specific capabilities or security permissions to your iOS or macOS app.\n" +
                                        "By default Entitlements file is generated based on your deploy settings, " +
                                        "but you may alos provide own version of the entitlements file by using manual mode", MessageType.Info);
                using (new IMGUIBeginHorizontal())
                {
                    GUILayout.FlexibleSpace();
                    var click = m_EntitlementsLink.DrawWithCalcSize();
                    if (click)
                    {
                        Application.OpenURL("https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy?language=objc");
                    }
                }

                EditorGUILayout.Space();

                XCodeProjectSettings.Instance.EntitlementsMode = (EntitlementsGenerationMode)IMGUILayout.EnumPopup("Generation Mode", XCodeProjectSettings.Instance.EntitlementsMode);
                if (XCodeProjectSettings.Instance.EntitlementsMode == EntitlementsGenerationMode.Manual)
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("Entitlements File:");
                    XCodeProjectSettings.Instance.EntitlementsFile = EditorGUILayout.ObjectField(XCodeProjectSettings.Instance.EntitlementsFile, typeof(Object), false);
                    EditorGUILayout.EndHorizontal();
                }
            }
        }
Beispiel #13
0
        public void Frameworks()
        {
            var framework_icon = EditorAssetDatabase.GetTextureAtPath(XCodeWindowSkin.IconsPath + "frameworks.png");

            using (new IMGUIWindowBlockWithIndent(new GUIContent("Frameworks", framework_icon)))
            {
                m_IsDefFrameworksOpen = EditorGUILayout.Foldout(m_IsDefFrameworksOpen,
                                                                "Show Default Unity Frameworks (" + FrameworkHandler.DefaultFrameworks.Count + "Enabled)");
                if (m_IsDefFrameworksOpen)
                {
                    var indentLevel = EditorGUI.indentLevel;
                    EditorGUI.indentLevel = 0;
                    using (new IMGUIBeginHorizontal())
                    {
                        GUILayout.Space(30);

                        using (new IMGUIBeginVertical(GUI.skin.box))
                        {
                            foreach (var framework in FrameworkHandler.DefaultFrameworks)
                            {
                                IMGUILayout.SelectableLabel(framework.FrameworkName.ToString() + ".framework", "");
                            }
                        }
                    }

                    EditorGUI.indentLevel = indentLevel;
                    EditorGUILayout.Space();
                }

                m_IsDefLibrariesOpen = EditorGUILayout.Foldout(m_IsDefLibrariesOpen, "Default Unity Libraries (2 Enabled)");
                if (m_IsDefLibrariesOpen)
                {
                    var indentLevel = EditorGUI.indentLevel;
                    EditorGUI.indentLevel = 0;
                    using (new IMGUIBeginHorizontal())
                    {
                        GUILayout.Space(30);

                        using (new IMGUIBeginVertical(GUI.skin.box))
                        {
                            IMGUILayout.SelectableLabel("libiPhone-lib.a", "");
                            IMGUILayout.SelectableLabel("libiconv.2.dylib", "");
                        }
                    }

                    EditorGUI.indentLevel = indentLevel;

                    EditorGUILayout.Space();
                }

                //Frameworks List
                IMGUILayout.ReorderablList(XCodeProjectSettings.Instance.Frameworks,
                                           (XCodeFramework framework) =>
                {
                    if (framework.IsOptional && framework.IsEmbeded)
                    {
                        return(framework.FullName + "       (Optional & Embeded)");
                    }
                    else if (framework.IsOptional)
                    {
                        return(framework.FullName + "        (Optional)");
                    }
                    else if (framework.IsEmbeded)
                    {
                        return(framework.FullName + "        (Embeded)");
                    }
                    else
                    {
                        return(framework.FullName);
                    }
                },
                                           (XCodeFramework framework) =>
                {
                    framework.IsOptional = IMGUILayout.ToggleFiled("Optional", framework.IsOptional, IMGUIToggleStyle.ToggleType.YesNo);
                    framework.IsEmbeded  = IMGUILayout.ToggleFiled("Embeded", framework.IsEmbeded, IMGUIToggleStyle.ToggleType.YesNo);
                }
                                           );

                //Libraries List
                IMGUILayout.ReorderablList(XCodeProjectSettings.Instance.Libraries,
                                           (XCodeLibrary lib) =>
                {
                    if (lib.IsOptional)
                    {
                        return(lib.FullName + "    (Optional)");
                    }
                    else
                    {
                        return(lib.FullName);
                    }
                },
                                           (XCodeLibrary lib) =>
                {
                    lib.IsOptional = IMGUILayout.ToggleFiled("Optional", lib.IsOptional, IMGUIToggleStyle.ToggleType.YesNo);
                }
                                           );

                //Add New Framework
                EditorGUILayout.BeginHorizontal();
                NewBaseFrameworkIndex = EditorGUILayout.Popup(NewBaseFrameworkIndex, FrameworkHandler.BaseFrameworksArray());

                if (GUILayout.Button("Add Framework", EditorStyles.miniButton, GUILayout.Width(100)))
                {
                    var type = FrameworkHandler.BaseFrameworksArray()[NewBaseFrameworkIndex];
                    NewBaseFrameworkIndex = 0;

                    var f = new XCodeFramework(type);
                    XCodeProject.AddFramework(f);
                }

                EditorGUILayout.EndHorizontal();

                //Add New Library
                EditorGUILayout.BeginHorizontal();
                NewLibraryIndex = EditorGUILayout.Popup(NewLibraryIndex, LibraryHandler.BaseLibrariesArray());

                if (GUILayout.Button("Add Library", EditorStyles.miniButton, GUILayout.Width(100)))
                {
                    var type = (XCodeLibraryName)LibraryHandler.EnumValueOf(LibraryHandler.BaseLibrariesArray()[NewLibraryIndex]);
                    NewLibraryIndex = 0;
                    XCodeProject.AddLibrary(type);
                }

                EditorGUILayout.EndHorizontal();
            }
        }
Beispiel #14
0
        public void Init(IQFrameworkContainer container)
        {
            Container = container;
            var localPackageVersionModel = this.GetModel <ILocalPackageVersionModel>();

            // 左侧
            mLeftLayout = EasyIMGUI.Vertical()
                          .AddChild(EasyIMGUI.Area().WithRectGetter(() => mLeftRect)
                                    // 间距 20
                                    .AddChild(EasyIMGUI.Vertical()
                                              .AddChild(EasyIMGUI.Space().Pixel(20)))
                                    // 搜索
                                    .AddChild(EasyIMGUI.Horizontal()
                                              .AddChild(EasyIMGUI.Label().Text("搜索:")
                                                        .FontBold()
                                                        .FontSize(12)
                                                        .Width(40)
                                                        ).AddChild(EasyIMGUI.TextField()
                                                                   .Height(20)
                                                                   .Self(search =>
            {
                search.Content
                .Bind(key => { this.SendCommand(new SearchCommand(key)); })
                .AddToDisposeList(mDisposableList);
            })
                                                                   )
                                              )

                                    // 权限
                                    .AddChild(EasyIMGUI.Toolbar()
                                              .Menus(new List <string>()
            {
                "All", PackageAccessRight.Public.ToString(), PackageAccessRight.Private.ToString()
            })
                                              .Self(self =>
            {
                self.IndexProperty.Bind(value =>
                {
                    PackageManagerState.AccessRightIndex.Value = value;
                    this.SendCommand(new SearchCommand(PackageManagerState.SearchKey.Value));
                }).AddToDisposeList(mDisposableList);
            }))
                                    // 分类
                                    .AddChild(
                                        EasyIMGUI.Horizontal()
                                        .AddChild(PopupView.Create()
                                                  .ToolbarStyle()
                                                  .Self(self =>
            {
                self.IndexProperty.Bind(value =>
                {
                    PackageManagerState.CategoryIndex.Value = value;
                    this.SendCommand(new SearchCommand(PackageManagerState.SearchKey.Value));
                }).AddToDisposeList(mDisposableList);

                mCategoriesSelectorView = self;
            }))
                                        )
                                    // 是否是官方
                                    .AddChild(
                                        EasyIMGUI.Horizontal()
                                        .AddChild(EasyIMGUI.Toggle().IsOn(mIsOfficial)
                                                  .Self(t => t.ValueProperty.Bind(v => mIsOfficial = v)))
                                        .AddChild(EasyIMGUI.Label().Text("官方"))
                                        .AddChild(EasyIMGUI.FlexibleSpace())
                                        )
                                    .AddChild(EasyIMGUI.Scroll()
                                              .AddChild(EasyIMGUI.Custom().OnGUI(() =>
            {
                PackageManagerState.PackageRepositories.Value
                .Where(p => p.isOfficial == mIsOfficial)
                .OrderByDescending(p =>
                {
                    var installedVersion = localPackageVersionModel.GetByName(p.name);

                    if (installedVersion == null)
                    {
                        return(-1);
                    }
                    else if (installedVersion.VersionNumber < p.VersionNumber)
                    {
                        return(2);
                    }
                    else if (installedVersion.VersionNumber == p.VersionNumber)
                    {
                        return(1);
                    }
                    else
                    {
                        return(0);
                    }
                })
                .ThenBy(p => p.name)
                .ForEach(p =>
                {
                    GUILayout.BeginVertical("box");

                    GUILayout.BeginHorizontal();
                    {
                        GUILayout.Label(p.name);
                        GUILayout.FlexibleSpace();
                    }
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal();
                    {
                        EasyIMGUI.Box().Text(p.latestVersion)
                        .Self(self => self.BackgroundColor = Color.green)
                        .DrawGUI();

                        GUILayout.FlexibleSpace();

                        var installedVersion = localPackageVersionModel.GetByName(p.name);

                        if (installedVersion == null)
                        {
                            if (GUILayout.Button(LocaleText.Import))
                            {
                                RenderEndCommandExecutor.PushCommand(() =>
                                {
                                    this.SendCommand(new ImportPackageCommand(p));
                                });
                            }
                        }
                        else if (installedVersion.VersionNumber < p.VersionNumber)
                        {
                            if (GUILayout.Button(LocaleText.Update))
                            {
                                RenderEndCommandExecutor.PushCommand(() =>
                                {
                                    this.SendCommand(new UpdatePackageCommand(p));
                                });
                            }
                        }
                        else if (installedVersion.VersionNumber == p.VersionNumber)
                        {
                            if (GUILayout.Button(LocaleText.Reimport))
                            {
                                RenderEndCommandExecutor.PushCommand(() =>
                                {
                                    this.SendCommand(new ReimportPackageCommand(p));
                                });
                            }
                        }
                    }
                    GUILayout.EndHorizontal();

                    GUILayout.EndVertical();

                    var rect = GUILayoutUtility.GetLastRect();

                    if (mSelectedPackageRepository == p)
                    {
                        GUI.Box(rect, "", mSelectionRect);
                    }

                    if (rect.Contains(Event.current.mousePosition) &&
                        Event.current.type == EventType.MouseUp)
                    {
                        mSelectedPackageRepository = p;
                        Event.current.Use();
                    }
                });
            }))
                                              )
                                    );

            // var skin = AssetDatabase.LoadAssetAtPath<GUISkin>(
            var skin = AssetDatabase.LoadAssetAtPath <GUISkin>(
                "Assets/QFramework/Framework/Toolkits/Core/Editor/Markdown/Skin/MarkdownSkinQS.guiskin");


            mMarkdownViewer = new MarkdownViewer(skin, string.Empty, "");
            // 右侧
            mRightLayout = EasyIMGUI.Vertical()
                           .AddChild(EasyIMGUI.Area().WithRectGetter(() => mRightRect)
                                     // 间距 20
                                     .AddChild(EasyIMGUI.Vertical()
                                               .AddChild(EasyIMGUI.Space().Pixel(20))
                                               )
                                     // 详细信息
                                     .AddChild(EasyIMGUI.Vertical()
                                               .WithVisibleCondition(() => mSelectedPackageRepository != null)
                                               // 名字
                                               .AddChild(EasyIMGUI.Label()
                                                         .TextGetter(() => mSelectedPackageRepository.name)
                                                         .FontSize(30)
                                                         .FontBold())
                                               .AddChild(EasyIMGUI.Space())
                                               // 服务器版本
                                               .AddChild(EasyIMGUI.Label()
                                                         .TextGetter(() => "服务器版本: " + mSelectedPackageRepository.latestVersion)
                                                         .FontSize(15))
                                               // 本地版本
                                               .AddChild(EasyIMGUI.Label()
                                                         .WithVisibleCondition(() =>
                                                                               localPackageVersionModel.GetByName(mSelectedPackageRepository.name).IsNotNull())
                                                         .TextGetter(() =>
                                                                     "本地版本:" + localPackageVersionModel.GetByName(mSelectedPackageRepository.name).Version)
                                                         .FontSize(15))
                                               // 作者
                                               .AddChild(EasyIMGUI.Label()
                                                         .TextGetter(() => "作者:" + mSelectedPackageRepository.author)
                                                         .FontSize(15))
                                               // 权限
                                               .AddChild(EasyIMGUI.Label()
                                                         .TextGetter(() => "权限:" + mSelectedPackageRepository.accessRight)
                                                         .FontSize(15))
                                               // 主页
                                               .AddChild(
                                                   EasyIMGUI.Horizontal()
                                                   .AddChild(EasyIMGUI.Label()
                                                             .FontSize(15)
                                                             .Text("插件主页:"))
                                                   .AddChild(EasyIMGUI.Button()
                                                             .TextGetter(() => UrlHelper.PackageUrl(mSelectedPackageRepository))
                                                             .FontSize(15)
                                                             .OnClick(() =>
            {
                this.SendCommand(new OpenDetailCommand(mSelectedPackageRepository));
            })
                                                             )
                                                   .AddChild(EasyIMGUI.FlexibleSpace())
                                                   )
                                               // 描述
                                               .AddChild(EasyIMGUI.Label()
                                                         .TextGetter(() => "描述:")
                                                         .FontSize(15)
                                                         )
                                               .AddChild(EasyIMGUI.Space())
                                               // 描述内容
                                               .AddChild(EasyIMGUI.Custom().OnGUI(() =>
            {
                mMarkdownViewer.UpdateText(mSelectedPackageRepository.description);
                var lastRect = GUILayoutUtility.GetLastRect();
                mMarkdownViewer.DrawWithRect(new Rect(lastRect.x, lastRect.y + lastRect.height,
                                                      mRightRect.width - 210, mRightRect.height - lastRect.y - lastRect.height));
                // mMarkdownViewer.Draw();
            }))
                                               )
                                     );

            mPackageKitWindow = EditorWindow.GetWindow <PackageKitWindow>();

            this.SendCommand <PackageManagerInitCommand>();


            PackageManagerState.Categories.Bind(value =>
            {
                mCategoriesSelectorView.Menus(value);
                mPackageKitWindow.Repaint();
            }).AddToDisposeList(mDisposableList);


            // 创建双屏
            mSplitView = mSplitView = new VerticalSplitView
            {
                Split   = 240,
                fistPan = rect =>
                {
                    mLeftRect = rect;
                    mLeftLayout.DrawGUI();
                },
                secondPan = rect =>
                {
                    mRightRect = rect;
                    mRightLayout.DrawGUI();
                }
            };
        }
        public static void DrawPlistVariable(InfoPlistKey plistKey, object valuePointer, IList valueOrigin)
        {
            EditorGUILayout.BeginHorizontal();

            if (plistKey.Name.Length > 0)
            {
                plistKey.IsOpen = EditorGUILayout.Foldout(plistKey.IsOpen, plistKey.Name + "   (" + plistKey.Type.ToString() + ")");
            }
            else
            {
                plistKey.IsOpen = EditorGUILayout.Foldout(plistKey.IsOpen, plistKey.Type.ToString());
            }

            var itemWasRemoved = SortingButtons(valuePointer, valueOrigin);

            if (itemWasRemoved)
            {
                XCodeProjectSettings.Instance.RemoveVariable(plistKey, valueOrigin);
                return;
            }

            EditorGUILayout.EndHorizontal();

            if (plistKey.IsOpen)
            {
                EditorGUI.indentLevel++;
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("Type");
                    if (plistKey.ChildrenIds.Count > 0)
                    {
                        GUI.enabled   = false;
                        plistKey.Type = (InfoPlistKeyType)EditorGUILayout.EnumPopup(plistKey.Type);
                    }
                    else
                    {
                        plistKey.Type = (InfoPlistKeyType)EditorGUILayout.EnumPopup(plistKey.Type);
                    }

                    EditorGUILayout.EndHorizontal();

                    if (plistKey.Type == InfoPlistKeyType.Array)
                    {
                        DrawArrayValues(plistKey);
                    }
                    else if (plistKey.Type == InfoPlistKeyType.Dictionary)
                    {
                        DrawDictionaryValues(plistKey);
                    }
                    else if (plistKey.Type == InfoPlistKeyType.Boolean)
                    {
                        plistKey.BooleanValue = IMGUILayout.ToggleFiled("Value", plistKey.BooleanValue, IMGUIToggleStyle.ToggleType.YesNo);
                    }
                    else
                    {
                        EditorGUILayout.BeginHorizontal();
                        EditorGUILayout.LabelField("Value");
                        switch (plistKey.Type)
                        {
                        case InfoPlistKeyType.Integer:
                            plistKey.IntegerValue = EditorGUILayout.IntField(plistKey.IntegerValue);
                            break;

                        case InfoPlistKeyType.String:
                            plistKey.StringValue = EditorGUILayout.TextField(plistKey.StringValue);
                            break;
                        }

                        EditorGUILayout.EndHorizontal();
                    }
                }
                EditorGUI.indentLevel--;
            }
        }
        public override void OnLayoutEnable()
        {
            base.OnLayoutEnable();

            m_CapabilitiesLayout = new List <CapabilityLayout>();

            //iCloud
            var layout = new CapabilityLayout("iCloud", "cloud.png", () => { return(XCodeProjectSettings.Instance.Capability.iCloud); }, () =>
            {
                using (new IMGUIHorizontalSpace(16))
                {
                    var cloud             = XCodeProjectSettings.Instance.Capability.iCloud;
                    cloud.KeyValueStorage = IMGUILayout.ToggleFiled("Key Value Storage", cloud.KeyValueStorage, IMGUIToggleStyle.ToggleType.EnabledDisabled);
                    cloud.iCloudDocument  = IMGUILayout.ToggleFiled("iCloud Document", cloud.iCloudDocument, IMGUIToggleStyle.ToggleType.EnabledDisabled);

                    ReorderableListGUI.Title("Custom Containers");
                    ReorderableListGUI.ListField(cloud.CustomContainers, (Rect position, string itemValue) =>
                    {
                        return(EditorGUI.TextField(position, itemValue));
                    }, () =>
                    {
                        GUILayout.Label("You haven't added any custom containers yet.");
                    });
                }
            });

            m_CapabilitiesLayout.Add(layout);

            //Push Notifications

            layout = new CapabilityLayout("Push Notifications", "push.png", () => { return(XCodeProjectSettings.Instance.Capability.PushNotifications); }, () =>
            {
                using (new IMGUIHorizontalSpace(16))
                {
                    var pushNotifications         = XCodeProjectSettings.Instance.Capability.PushNotifications;
                    pushNotifications.Development = IMGUILayout.ToggleFiled("Development", pushNotifications.Development, IMGUIToggleStyle.ToggleType.YesNo);
                }
            });

            m_CapabilitiesLayout.Add(layout);

            //Game Center
            layout = new CapabilityLayout("Game Center", "game.png", () => { return(XCodeProjectSettings.Instance.Capability.GameCenter); }, () => { });
            m_CapabilitiesLayout.Add(layout);

            //Game Center
            layout = new CapabilityLayout("Sign In With Apple", "keychaine.png", () => { return(XCodeProjectSettings.Instance.Capability.SignInWithApple); }, () => { });
            m_CapabilitiesLayout.Add(layout);

            //Wallet

            layout = new CapabilityLayout("Wallet", "wallet.png", () => { return(XCodeProjectSettings.Instance.Capability.Wallet); }, () =>
            {
                var wallet = XCodeProjectSettings.Instance.Capability.Wallet;
                using (new IMGUIBeginHorizontal())
                {
                    GUILayout.Space(16);
                    using (new IMGUIBeginVertical())
                    {
                        ReorderableListGUI.Title("Pass Subset");
                        ReorderableListGUI.ListField(wallet.PassSubset, EditorGUI.TextField, () =>
                        {
                            GUILayout.Label("You haven't added any pass subset.");
                        });
                    }
                }
            });
            m_CapabilitiesLayout.Add(layout);

            //Siri
            layout = new CapabilityLayout("Siri", "siri.png", () => { return(XCodeProjectSettings.Instance.Capability.Siri); }, () => { });
            m_CapabilitiesLayout.Add(layout);

            //ApplePay

            layout = new CapabilityLayout("Apple Pay", "pay.png", () => { return(XCodeProjectSettings.Instance.Capability.ApplePay); }, () =>
            {
                var applePay = XCodeProjectSettings.Instance.Capability.ApplePay;
                using (new IMGUIBeginHorizontal())
                {
                    GUILayout.Space(16);
                    using (new IMGUIBeginVertical())
                    {
                        ReorderableListGUI.Title("Merchants");
                        ReorderableListGUI.ListField(applePay.Merchants, (Rect position, string itemValue) =>
                        {
                            return(EditorGUI.TextField(position, itemValue));
                        }, () =>
                        {
                            GUILayout.Label("You haven't added any merchants yet.");
                        });
                    }
                }
            });
            m_CapabilitiesLayout.Add(layout);

            //InAppPurchase
            layout = new CapabilityLayout("In-App Purchase", "purchase.png", () => { return(XCodeProjectSettings.Instance.Capability.InAppPurchase); }, () => { });
            m_CapabilitiesLayout.Add(layout);

            //Maps
            layout = new CapabilityLayout("Maps", "maps.png", () => { return(XCodeProjectSettings.Instance.Capability.Maps); }, () =>
            {
                var maps = XCodeProjectSettings.Instance.Capability.Maps;
                using (new IMGUIBeginHorizontal())
                {
                    GUILayout.Space(16);
                    using (new IMGUIBeginVertical())
                    {
                        ReorderableListGUI.Title("Options");
                        ReorderableListGUI.ListField(maps.Options, (Rect position, XCodeCapabilitySettings.MapsCapability.MapsOptions itemValue) =>
                        {
                            return((XCodeCapabilitySettings.MapsCapability.MapsOptions)EditorGUI.EnumPopup(position, itemValue));
                        }, () =>
                        {
                            GUILayout.Label("Set maps capability options.");
                        });
                    }
                }
            });
            m_CapabilitiesLayout.Add(layout);

            //PersonalVPN
            layout = new CapabilityLayout("Personal VPN", "vpn.png", () => { return(XCodeProjectSettings.Instance.Capability.PersonalVPN); }, () => { });
            m_CapabilitiesLayout.Add(layout);

            //BackgroundModes
            layout = new CapabilityLayout("Background Modes", "back.png", () => { return(XCodeProjectSettings.Instance.Capability.BackgroundModes); }, () =>
            {
                var backgroundModes = XCodeProjectSettings.Instance.Capability.BackgroundModes;

                using (new IMGUIBeginHorizontal())
                {
                    GUILayout.Space(16);
                    using (new IMGUIBeginVertical())
                    {
                        ReorderableListGUI.Title("Options");
                        ReorderableListGUI.ListField(backgroundModes.Options, (Rect position, XCodeCapabilitySettings.BackgroundModesCapability.BackgroundModesOptions itemValue) =>
                        {
                            return((XCodeCapabilitySettings.BackgroundModesCapability.BackgroundModesOptions)EditorGUI.EnumPopup(position, itemValue));
                        }, () =>
                        {
                            GUILayout.Label("Set background modes capability options.");
                        });
                    }
                }
            });
            m_CapabilitiesLayout.Add(layout);

            //InterAppAudio
            layout = new CapabilityLayout("Inter-App Audio", "inter.png", () => { return(XCodeProjectSettings.Instance.Capability.InterAppAudio); }, () => { });
            m_CapabilitiesLayout.Add(layout);

            //KeychainSharing
            layout = new CapabilityLayout("Keychain Sharing", "keychaine.png", () => { return(XCodeProjectSettings.Instance.Capability.KeychainSharing); }, () =>
            {
                var keychainSharing = XCodeProjectSettings.Instance.Capability.KeychainSharing;

                using (new IMGUIBeginHorizontal())
                {
                    GUILayout.Space(16);
                    using (new IMGUIBeginVertical())
                    {
                        ReorderableListGUI.Title("Access Groups");
                        ReorderableListGUI.ListField(keychainSharing.AccessGroups, (Rect position, string itemValue) =>
                        {
                            return(EditorGUI.TextField(position, itemValue));
                        }, () =>
                        {
                            GUILayout.Label("You haven't added any access groups yet.");
                        });
                    }
                }
            });
            m_CapabilitiesLayout.Add(layout);

            //AssociatedDomains
            layout = new CapabilityLayout("Associated Domains", "associated.png", () => { return(XCodeProjectSettings.Instance.Capability.AssociatedDomains); }, () =>
            {
                var associatedDomains = XCodeProjectSettings.Instance.Capability.AssociatedDomains;

                using (new IMGUIBeginHorizontal())
                {
                    GUILayout.Space(16);
                    using (new IMGUIBeginVertical())
                    {
                        ReorderableListGUI.Title("Associated Domains");
                        ReorderableListGUI.ListField(associatedDomains.Domains, (Rect position, string itemValue) =>
                        {
                            return(EditorGUI.TextField(position, itemValue));
                        }, () =>
                        {
                            GUILayout.Label("You haven't added any domains yet.");
                        });
                    }
                }
            });
            m_CapabilitiesLayout.Add(layout);

            //AssociatedDomains
            layout = new CapabilityLayout("App Groups", "app.png", () => { return(XCodeProjectSettings.Instance.Capability.AppGroups); }, () =>
            {
                var appGroups = XCodeProjectSettings.Instance.Capability.AppGroups;

                using (new IMGUIBeginHorizontal())
                {
                    GUILayout.Space(16);
                    using (new IMGUIBeginVertical())
                    {
                        ReorderableListGUI.Title("Groups");
                        ReorderableListGUI.ListField(appGroups.Groups, (Rect position, string itemValue) =>
                        {
                            return(EditorGUI.TextField(position, itemValue));
                        }, () =>
                        {
                            GUILayout.Label("You haven't added any groups yet.");
                        });
                    }
                }
            });
            m_CapabilitiesLayout.Add(layout);

            //InterAppAudio
            layout = new CapabilityLayout("Data Protection", "data.png", () => { return(XCodeProjectSettings.Instance.Capability.DataProtection); }, () => { });
            m_CapabilitiesLayout.Add(layout);

            //InterAppAudio
            layout = new CapabilityLayout("HomeKit", "homekit.png", () => { return(XCodeProjectSettings.Instance.Capability.HomeKit); }, () => { });
            m_CapabilitiesLayout.Add(layout);

            //InterAppAudio
            layout = new CapabilityLayout("HealthKit", "healhtkit.png", () => { return(XCodeProjectSettings.Instance.Capability.HealthKit); }, () => { });
            m_CapabilitiesLayout.Add(layout);

            //InterAppAudio
            layout = new CapabilityLayout("Wireless Accessory Configuration", "wirelless.png", () => { return(XCodeProjectSettings.Instance.Capability.WirelessAccessoryConfiguration); }, () => { });
            m_CapabilitiesLayout.Add(layout);
        }