public static void Export(string configPath) { if (File.Exists(configPath) == false) { string msg = string.Format("config in path '{0}' is not found!", configPath); throw new ArgumentException(msg); } ExportConfig config = new ExportConfig(); config = JsonConfigFileManager.Load(config, configPath); if (string.IsNullOrEmpty(config.VersionFilename) == false) { UpdateVersionFile(config.AssetDirectory + "/" + config.VersionFilename, config.Version); } // Create the output directory if it doesn't exist yet. string outputDirectory = Path.GetDirectoryName(config.OutputPath.Replace('/', '\\')); if (string.IsNullOrEmpty(outputDirectory) == false && Directory.Exists(outputDirectory) == false) { Directory.CreateDirectory(outputDirectory); } string[] exportedPaths = GetAssetPathsToExport(config); AssetDatabase.ExportPackage(exportedPaths, config.OutputPath.Replace('/', '\\'), ExportPackageOptions.Default); }