public void Export(IExportContainer container, Object asset, string path)
 {
     using (FileStream fileStream = File.Open(path, FileMode.Create, FileAccess.Write))
     {
         using (StreamWriter streamWriter = new StreamWriter(fileStream))
         {
             YAMLWriter   writer = new YAMLWriter();
             YAMLDocument doc    = asset.ExportYAMLDocument(container);
             writer.AddDocument(doc);
             writer.Write(streamWriter);
         }
     }
 }
Exemplo n.º 2
0
 public void Export(IExportContainer container, Object asset, string path, Action <IExportContainer, Object, string> callback)
 {
     using (FileStream fileStream = FileUtils.Open(path, FileMode.Create, FileAccess.Write))
     {
         using (StreamWriter streamWriter = new StreamWriter(fileStream))
         {
             YAMLWriter   writer = new YAMLWriter();
             YAMLDocument doc    = asset.ExportYAMLDocument(container);
             writer.AddDocument(doc);
             writer.Write(streamWriter);
         }
     }
     callback?.Invoke(container, asset, path);
 }
Exemplo n.º 3
0
 private void ExportYAML(IAssetsExporter exporter, Object asset, string path)
 {
     using (FileStream fileStream = File.Open(path, FileMode.Create, FileAccess.Write))
     {
         using (StreamWriter streamWriter = new StreamWriter(fileStream))
         {
             YAMLWriter writer = new YAMLWriter();
             exporter.File = asset.File;
             YAMLDocument doc = asset.ExportYAMLDocument(exporter);
             writer.AddDocument(doc);
             writer.Write(streamWriter);
         }
     }
 }