GetDefaultFilePathForFileLocation() 공개 정적인 메소드

public static GetDefaultFilePathForFileLocation ( PresetFileLocation fileLocation ) : string
fileLocation PresetFileLocation
리턴 string
예제 #1
0
        private string CreateNewLibraryCallback(string libraryName, PresetFileLocation fileLocation)
        {
            string presetLibraryPathWithoutExtension = Path.Combine(PresetLibraryLocations.GetDefaultFilePathForFileLocation(fileLocation), libraryName);

            if (this.CreateNewLibrary(presetLibraryPathWithoutExtension) != null)
            {
                this.currentLibraryWithoutExtension = presetLibraryPathWithoutExtension;
            }
            return(ScriptableSingleton <PresetLibraryManager> .instance.GetLastError());
        }
예제 #2
0
        // Returns an error string. If no errors occured then null is returned
        string CreateNewLibraryCallback(string libraryName, PresetFileLocation fileLocation)
        {
            string defaultPath          = PresetLibraryLocations.GetDefaultFilePathForFileLocation(fileLocation);
            string pathWithoutExtension = Path.Combine(defaultPath, libraryName);

            if (CreateNewLibrary(pathWithoutExtension) != null)
            {
                currentLibraryWithoutExtension = pathWithoutExtension;
            }
            return(PresetLibraryManager.instance.GetLastError());
        }
        private static List <string> GetDirectoryPaths(PresetFileLocation fileLocation)
        {
            List <string> stringList = new List <string>();

            switch (fileLocation)
            {
            case PresetFileLocation.PreferencesFolder:
                stringList.Add(PresetLibraryLocations.GetDefaultFilePathForFileLocation(PresetFileLocation.PreferencesFolder));
                break;

            case PresetFileLocation.ProjectFolder:
                string[] directories = Directory.GetDirectories("Assets/", "Editor", SearchOption.AllDirectories);
                stringList.AddRange((IEnumerable <string>)directories);
                break;

            default:
                Debug.LogError((object)"Enum not handled!");
                break;
            }
            return(stringList);
        }
예제 #4
0
        private static List <string> GetDirectoryPaths(PresetFileLocation fileLocation)
        {
            List <string> list = new List <string>();

            if (fileLocation != PresetFileLocation.PreferencesFolder)
            {
                if (fileLocation != PresetFileLocation.ProjectFolder)
                {
                    Debug.LogError("Enum not handled!");
                }
                else
                {
                    string[] directories = Directory.GetDirectories("Assets/", "Editor", SearchOption.AllDirectories);
                    list.AddRange(directories);
                }
            }
            else
            {
                list.Add(PresetLibraryLocations.GetDefaultFilePathForFileLocation(PresetFileLocation.PreferencesFolder));
            }
            return(list);
        }
예제 #5
0
        // Returns an error string. If no errors occured then null is returned
        string CreateNewLibraryCallback(string libraryName, PresetFileLocation fileLocation)
        {
            if (libraryName.Contains(":"))
            {
                return("A filename cannot contain the following character ':'");
            }

            string defaultPath = PresetLibraryLocations.GetDefaultFilePathForFileLocation(fileLocation);

            if (libraryName.StartsWith("\\") || libraryName.StartsWith("/"))
            {
                libraryName = libraryName.Substring(1);
            }

            string pathWithoutExtension = Path.Combine(defaultPath, libraryName);

            if (CreateNewLibrary(pathWithoutExtension) != null)
            {
                currentLibraryWithoutExtension = pathWithoutExtension;
            }
            return(PresetLibraryManager.instance.GetLastError());
        }