public void DrawInspector()
        {
            VectorImageManagerWindow.DrawHeader("Parameters");
            {
                VectorImageManagerWindow.BeginContents();
                {
                    EditorGUILayout.HelpBox(
                        "Specify where you want to save all the fonts imported using VectorImageManager. (relative to your Assets/ folder)",
                        MessageType.Info);

                    using (new GUILayout.HorizontalScope())
                    {
                        EditorGUI.BeginChangeCheck();
                        m_IconFontDestinationFolder =
                            EditorGUILayout.TextField("Destination folder", m_IconFontDestinationFolder);
                        if (EditorGUI.EndChangeCheck())
                        {
                            UpdateFontDestinationFolder(m_IconFontDestinationFolder);
                        }

                        if (GUILayout.Button("Select folder", EditorStyles.miniButton, GUILayout.Width(75f)))
                        {
                            GUI.FocusControl(null);

                            var folderPath = EditorUtility.OpenFolderPanel("VectorImage Fonts destination folder",
                                                                           Application.dataPath, null);

                            if (string.IsNullOrEmpty(folderPath))
                            {
                                return;
                            }

                            if (!folderPath.Contains(Application.dataPath))
                            {
                                EditorUtility.DisplayDialog("Error",
                                                            "The folder you select, must be inside your Assets/ folder", "Ok");
                                return;
                            }

                            folderPath = folderPath.Replace(Application.dataPath, string.Empty);
                            UpdateFontDestinationFolder(folderPath);
                        }
                    }
                }
                VectorImageManagerWindow.EndContents();
            }
        }
示例#2
0
        public void DrawInspector()
        {
            VectorImageManagerWindow.DrawHeader("Import custom icon fonts");
            {
                VectorImageManagerWindow.BeginContents();
                {
                    EditorGUILayout.HelpBox(
                        "To create a custom font with your own svg files, you just need to go on one of these websites, follow the steps, download the zip file and finaly import it using the 'Import' button below.",
                        MessageType.Info);

                    for (var i = 0; i < vectorImageFontParserArray.Length; i++)
                    {
                        var vectorImageFontParser = vectorImageFontParserArray[i];

                        using (new GUILayout.VerticalScope())
                        {
                            using (new GUILayout.HorizontalScope())
                            {
                                EditorGUILayout.LabelField(m_IconFontParserNameArray[i], EditorStyles.boldLabel,
                                                           GUILayout.Width(110f));

                                GUILayout.FlexibleSpace();

                                if (GUILayout.Button("Website", EditorStyles.miniButtonLeft, GUILayout.Width(60f)))
                                {
                                    Application.OpenURL(vectorImageFontParser.GetWebsite());
                                }

                                if (GUILayout.Button("Import", EditorStyles.miniButtonRight, GUILayout.Width(60f)))
                                {
                                    vectorImageFontParser.DownloadIcons(() =>
                                    {
                                        Debug.Log("Your custom font has been imported to " +
                                                  vectorImageFontParser.GetFolderPath());
                                    });
                                }

                                GUILayout.Space(2f);
                            }
                        }
                    }
                }
                VectorImageManagerWindow.EndContents();
            }
        }
        public void DrawInspector()
        {
            VectorImageManagerWindow.DrawHeader("Import web icon fonts");
            {
                VectorImageManagerWindow.BeginContents();
                {
                    DrawWebFontLine(materialDesignVectorImageFont, false);

                    EditorGUILayout.Separator();
                    EditorGUILayout.HelpBox("Please check the license that will be downloaded with each font before using an icon font.", MessageType.Info);

                    for (int i = 0; i < vectorImageFontParserArray.Length; i++)
                    {
                        DrawWebFontLine(vectorImageFontParserArray[i]);
                    }
                }
                VectorImageManagerWindow.EndContents();
            }
        }
示例#4
0
        private static void ShowWindow()
        {
            VectorImageManagerWindow window = (VectorImageManagerWindow)EditorWindow.GetWindow(typeof(VectorImageManagerWindow), false, " VectorImage Manager");

            window.minSize = new Vector2(390, 300);
        }