コード例 #1
0
        public static void Library()
        {
            SA.Common.Editor.Tools.BlockHeader("LIBRARIES");


            EditorGUILayout.BeginHorizontal();
            EditorGUI.indentLevel++;
            ISD_Settings.Instance.IsDefLibrariesOpen = EditorGUILayout.Foldout(ISD_Settings.Instance.IsDefLibrariesOpen, "Default Unity Libraries (2 Enabled)");
            EditorGUI.indentLevel--;
            EditorGUILayout.EndHorizontal();

            if (ISD_Settings.Instance.IsDefLibrariesOpen)
            {
                EditorGUILayout.BeginVertical(GUI.skin.box);

                SA.Common.Editor.Tools.SelectableLabel("libiPhone-lib.a", "");
                SA.Common.Editor.Tools.SelectableLabel("libiconv.2.dylib", "");

                EditorGUILayout.EndVertical();


                EditorGUILayout.Space();
            }
            EditorGUILayout.Space();
            DrawSeparatorLine();


            EditorGUILayout.LabelField("Custom Libraries", EditorStyles.boldLabel);
            if (ISD_Settings.Instance.Libraries.Count == 0)
            {
                EditorGUILayout.HelpBox("No Libraries added", MessageType.None);
            }


            EditorGUI.indentLevel++; {
                foreach (Lib lib in ISD_Settings.Instance.Libraries)
                {
                    EditorGUILayout.BeginVertical(GUI.skin.box);

                    EditorGUILayout.BeginHorizontal();
                    lib.IsOpen = EditorGUILayout.Foldout(lib.IsOpen, lib.Name);
                    if (lib.IsOptional)
                    {
                        EditorGUILayout.LabelField("(Optional)");
                    }

                    bool ItemWasRemoved = SA.Common.Editor.Tools.SrotingButtons((object)lib, ISD_Settings.Instance.Libraries);
                    if (ItemWasRemoved)
                    {
                        return;
                    }
                    EditorGUILayout.EndHorizontal();

                    if (lib.IsOpen)
                    {
                        lib.IsOptional = SA.Common.Editor.Tools.YesNoFiled("Optional", lib.IsOptional);
                        EditorGUILayout.Space();
                    }


                    EditorGUILayout.EndVertical();
                }
            } EditorGUI.indentLevel--;

            //EditorGUILayout.Space();


            EditorGUILayout.BeginHorizontal();
            EditorStyles.popup.fixedHeight = 20;
            NewLibraryIndex = EditorGUILayout.Popup(NewLibraryIndex, ISD_LibHandler.BaseLibrariesArray());

            if (GUILayout.Button("Add Library", GUILayout.Height(20)))
            {
                iOSLibrary type = (iOSLibrary)ISD_LibHandler.enumValueOf(ISD_LibHandler.BaseLibrariesArray()[NewLibraryIndex]);

                NewLibraryIndex = 0;
                Debug.Log("Adding new library with type  = " + type.ToString());
                ISD_Settings.Instance.AddLibrary(type);
            }

            EditorGUILayout.EndHorizontal();



            DrawSeparatorLine();



            List <string> foundedLibraries = ISD_FrameworkHandler.GetImportedLibraries();

            if (foundedLibraries.Count > 0)
            {
                EditorGUILayout.LabelField("Libraries Inide Current Project", EditorStyles.boldLabel);
                EditorGUILayout.BeginVertical(GUI.skin.box);
                foreach (string s in foundedLibraries)
                {
                    SA.Common.Editor.Tools.SelectableLabel(s, "");
                }
                EditorGUILayout.EndVertical();
            }
        }
コード例 #2
0
        public static void Library()
        {
            SA.Common.Editor.Tools.BlockHeader("LIBRARIES");


            EditorGUILayout.BeginHorizontal();
            EditorGUI.indentLevel++;
            ISD_Settings.Instance.IsDefLibrariesOpen = EditorGUILayout.Foldout(ISD_Settings.Instance.IsDefFrameworksOpen, "Default Unity Libraries (2 Enabled)");
            EditorGUI.indentLevel--;
            EditorGUILayout.EndHorizontal();

            if (ISD_Settings.Instance.IsDefLibrariesOpen)
            {
                EditorGUILayout.BeginVertical(GUI.skin.box);

                SA.Common.Editor.Tools.SelectableLabel("libiPhone-lib.a", "");
                SA.Common.Editor.Tools.SelectableLabel("libiconv.2.dylib", "");

                EditorGUILayout.EndVertical();


                EditorGUILayout.Space();
            }

            SA.Common.Editor.Tools.DrawSeparatorLine();



            EditorGUILayout.LabelField("Custom Libraries", EditorStyles.boldLabel);
            if (ISD_Settings.Instance.Libraries.Count == 0)
            {
                EditorGUILayout.HelpBox("No Libraries added", MessageType.None);
            }


            EditorGUI.indentLevel++; {
                foreach (Lib lib in ISD_Settings.Instance.Libraries)
                {
                    EditorGUILayout.BeginVertical(GUI.skin.box);

                    EditorGUILayout.BeginHorizontal();
                    lib.IsOpen = EditorGUILayout.Foldout(lib.IsOpen, lib.Name);
                    if (lib.IsOptional)
                    {
                        EditorGUILayout.LabelField("(Optional)");
                    }

                    bool ItemWasRemoved = SA.Common.Editor.Tools.SrotingButtons((object)lib, ISD_Settings.Instance.Libraries);
                    if (ItemWasRemoved)
                    {
                        return;
                    }
                    EditorGUILayout.EndHorizontal();

                    if (lib.IsOpen)
                    {
                        lib.Name       = SA.Common.Editor.Tools.TextField("Full Name:", lib.Name);
                        lib.IsOptional = SA.Common.Editor.Tools.YesNoFiled("Optional", lib.IsOptional);
                        EditorGUILayout.Space();
                    }


                    EditorGUILayout.EndVertical();
                }
            } EditorGUI.indentLevel--;

            EditorGUILayout.Space();

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.Space();
            if (GUILayout.Button("Add New Library", GUILayout.Width(250)))
            {
                Lib lib = new Lib();
                lib.Name = "NewLibrary";
                ISD_Settings.Instance.Libraries.Add(lib);
            }
            EditorGUILayout.Space();
            EditorGUILayout.EndHorizontal();



            SA.Common.Editor.Tools.DrawSeparatorLine();



            List <string> foundedLibraries = ISD_FrameworkHandler.GetImportedLibraries();

            if (foundedLibraries.Count > 0)
            {
                EditorGUILayout.LabelField("Libraries Inide Current Project", EditorStyles.boldLabel);
                EditorGUILayout.BeginVertical(GUI.skin.box);
                //GUI.enabled = false;
                foreach (string s in foundedLibraries)
                {
                    SA.Common.Editor.Tools.SelectableLabel(s, "");
                }
                //GUI.enabled = true;
                EditorGUILayout.EndVertical();
            }
        }