Vixen
02b45cc4
csharp
public static class AssetFile

Reading and writing the text of an asset, without losing it halfway.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Every document in this assembly writes a text file back, and every one of them wants the same two things: LF regardless of the platform, and a write that cannot leave a truncated file where the work was. SceneSerializer.Save already does both; this is the same two lines, in the one place the rest of the asset editors can reach.

⚠ LF on every platform. .gitattributes declares these files text, and a Windows checkout that wrote CRLF would make every asset it touched a whole-file diff — which is the same reason AssetMetaFile.WriteFile says so.

Methods (2)

  • public static string Read(string path)

    Reads a file, or an empty string if it is not there.

  • public static void Write(string path, string text)

    Writes a file, atomically, creating its directory if it is not there.

Used by (18)

  • AddressableGroupDocumentVixen.Editor.AssetEditors
  • AnimationClipDocumentVixen.Editor.AssetEditors
  • AnimationGraphDocumentVixen.Editor.AssetEditors
  • AssetFileTestsVixen.Editor.AssetEditors.Tests
  • AudioMixerDocumentVixen.Editor.AssetEditors
  • CodeDocumentVixen.Editor.AssetEditors
  • CompositorDocumentVixen.Editor.AssetEditors
  • FontDocumentVixen.Editor.AssetEditors
  • HarnessDocumentVixen.Editor.AssetEditors
  • ImportSettingsDocumentVixen.Editor.AssetEditors
  • InputActionsDocumentVixen.Editor.AssetEditors
  • MaterialDocumentVixen.Editor.AssetEditors
  • MoveSetDocumentVixen.Editor.AssetEditors
  • ProxyShapeDocumentVixen.Editor.AssetEditors
  • SequenceDocumentVixen.Editor.AssetEditors
  • ShaderGraphDocumentVixen.Editor.AssetEditors
  • ShapeVocabularyDocumentVixen.Editor.AssetEditors
  • VfxDocumentVixen.Editor.AssetEditors