public static void Export(string baseDir, string exportPath) { { var relativePath = ExportSetting.instance.GetExportPath(exportPath); var filePath = PathHelper.CheckFileName(System.IO.Path.Combine(baseDir, relativePath)); var fileDir = PathHelper.GetFileDirectory(filePath); if (!System.IO.Directory.Exists(fileDir)) { System.IO.Directory.CreateDirectory(fileDir); } var gltfFile = File.CreateText(filePath); SerializeObject.currentData.Serialize(gltfFile); gltfFile.Close(); MyLog.Log("---导出文件:" + relativePath); } { foreach (var asset in SerializeObject.assetsData.Values) { var relativePath = ExportSetting.instance.GetExportPath(asset.uri); var filePath = PathHelper.CheckFileName(System.IO.Path.Combine(baseDir, relativePath)); var fileDir = PathHelper.GetFileDirectory(filePath); if (!System.IO.Directory.Exists(fileDir)) { System.IO.Directory.CreateDirectory(fileDir); } System.IO.File.WriteAllBytes(filePath, asset.buffer); } } }