/* Get Directory Paths */ #region Directory Paths /// <summary> /// /// </summary> /// <param name="location"></param> /// <returns></returns> private static string BaseDirectoryPath(WindowsDataLocation location) { string path = ""; switch (location) { case WindowsDataLocation.MyDocuments: path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "/"; break; case WindowsDataLocation.MyGames: path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "/My Games/"; break; case WindowsDataLocation.UserData: path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/"; break; case WindowsDataLocation.GameFolder: path = Application.dataPath + "/"; break; } return(path.Replace("\\", "/")); }
/// <summary> /// Get absolute path to windows data location, including game name and child folder /// </summary> /// <param name="location">Location to find <seealso cref="WindowsDataLocation"/></param> /// <param name="GameFolderName">Name of the games folder</param> /// <param name="folder">Folder to find <seealso cref="Folders"/></param> /// <returns>Path to location</returns> public static string GetFolderPath(WindowsDataLocation location, string GameFolderName, Folders folder) { return(BaseDirectoryPath(location) + GameFolderName + "/" + folder.ToString() + "/"); }
/* Static Helpers */ #region Static Helpers /// <summary> /// Get absolute path to windows data location /// </summary> /// <param name="location">Location to find <seealso cref="WindowsDataLocation"/></param> /// <returns>Path to location</returns> public static string GetDirectoryPath(WindowsDataLocation location) { return(BaseDirectoryPath(location)); }