/// <summary> /// Adds a folder to the passed COCDomain at the relative path starting from the Unity Assets folder, Game Asset Root, /// and down the array of subfolders corresponding to args. /// </summary> /// <param name="domain"></param> /// <param name="args"></param> public static void AddGameConvention(COCDomain domain, params string[] args) { // If no folder names were provided, return. if (args.Length == 0) { return; } var relativeFolderPath = COCUtility.GetGamePath(domain, args); var absoluteFolderPath = Path.Combine(COCUtility.GetUnityAssetRoot(), relativeFolderPath); if (!Directory.Exists(absoluteFolderPath)) { Directory.CreateDirectory(absoluteFolderPath); Debug.LogFormat("[COC] Folder created at \"{0}\"", absoluteFolderPath); } COCUtility.PreserveFolder(relativeFolderPath); }
/// <summary> /// Returns a path starting from the game asset root and domain and descending down an array /// of subfolders corresponding to args. /// </summary> /// <param name="domain"> /// The COCDomain to reference in the path. /// </param> /// <param name="args"> /// An optional array of subfolders where each folder in the array relates /// as a subfolder to the previous index. /// </param> /// <returns></returns> public static string GetGamePath(COCDomain domain, params string[] args) { return(Path.Combine(GAME_ASSET_ROOT, domain.ToString(), GetPath(args))); }