Beispiel #1
0
        private static void RenderAdvancedView(MVCEditor editor)
        {
            EditorGUILayout.HelpBox(
                "Advanced view settings should NOT be touched in general cases.\nUnless you have full understanding" +
                "of this framework's process, it's highly recommended to just leave the settings as-is.",
                MessageType.Warning
                );

            RenderSpace();

            EditorGUILayout.LabelField(
                "Current workspace directory: " + NyanPath.EditorRelativePath(MvcWorkspace.WorkspacePath)
                );
            EditorGUILayout.HelpBox(
                "If you change the workspace directory, you must move/delete script files already created in " +
                "the previous directory.",
                MessageType.Warning
                );
            if (GUILayout.Button("Change workspace directory"))
            {
                MVCEditor.SelectWorkspaceDirectory();
            }

            RenderSpace();

            EditorGUILayout.LabelField("Default base class of MVC views.");
            Config.SetBaseClassName(EditorGUILayout.TextField(
                                        "BaseClassName",
                                        Config.BaseClassName
                                        ));
        }
Beispiel #2
0
        /// <summary>
        /// Opens a folder selector window and returns the selected file's path.
        /// If cancelled, null is returned.
        /// </summary>
        public static string OpenDirectory(bool saveLastPath = false, bool getRelativePath = false)
        {
            string result = EditorUtility.OpenFolderPanel("Select a folder", LastFolderPath, null);

            if (string.IsNullOrEmpty(result))
            {
                return(null);
            }

            if (saveLastPath)
            {
                LastFolderPath = result;
            }

            if (getRelativePath)
            {
                return(NyanPath.EditorRelativePath(result));
            }
            return(result);
        }
Beispiel #3
0
        /// <summary>
        /// Opens a file selector window and returns the selected file's path.
        /// If cancelled, null is returned.
        /// </summary>
        public static string OpenFile(string extensions = "", bool saveLastPath = false, bool getRelativePath = false)
        {
            string result = EditorUtility.OpenFilePanel("Select a file", LastFilePath, extensions);

            if (string.IsNullOrEmpty(result))
            {
                return(null);
            }

            if (saveLastPath)
            {
                LastFilePath = result;
            }

            if (getRelativePath)
            {
                return(NyanPath.EditorRelativePath(result));
            }
            return(result);
        }