public static class SceneSerializerTurns a scene document into a file and back.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The authoring format, not the runtime one. A content build compiles a .vxscene into whatever loads fastest; this is what a person opens, diffs and resolves a merge in. That is why it is YAML through the same binder a material and a settings asset go through, and why nothing about it is shaped for load speed.
Reading is not the reverse of writing, and the asymmetry is the whole design. Writing walks the world and asks the document what each entity is called and what it is named in a file. Reading creates entities in a world that has no idea what they used to be, and hands each one the id the file gave it — so a second save writes the same ids, a reference between entities survives a round trip, and a scene that has been opened and saved is byte-identical to the one that went in.
⚠ A parent is created before anything that hangs from it. The file nests children, so a depth-first walk gets that for free; a flat file with parent ids would need two passes, which is one of the reasons the format nests.
Fields and properties (1)
public const string ExtensionThe extension a scene is written as.
Methods (7)
public static SceneFile ToFile(SceneDocument document)Reads a document into a file.
public static string ToYaml(SceneDocument document)Writes a document as YAML.
public static void Save(SceneDocument document, string path)Writes a document to a path, creating the directory if it is not there.
public static SceneFile FromYaml(string yaml)Reads YAML into a file.
public static int Load(SceneDocument document, SceneFile file)Puts a file's entities into a document.
public static int Load(SceneDocument document, string path)Reads a scene off disk into a document.
public static Entity Instantiate(SceneDocument document, SceneEntityData data, Entity parent = default(Entity), IDictionary<Entity, EntityId>? sources = null)Creates one file entity, and everything under it, inside a document.
Used by (16)
- BehaviorSceneTestsVixen.Editor.SceneView.Tests
- BlockoutBooleanTestsVixen.Editor.Blockout.Tests
- BlockoutCreateTestsVixen.Editor.Blockout.Tests
- BlockoutSurfaceTestsVixen.Editor.Blockout.Tests
- CompiledSceneViewVixen.Editor.AssetEditors
- EditMeshSceneTestsVixen.Editor.SceneView.Tests
- EditorApplicationVixen.Editor.App
- LightTestsVixen.Editor.SceneView.Tests
- PrefabVixen.Editor.AssetEditors
- PrefabEditorFactoryVixen.Editor.AssetEditors
- PrefabFileWriterVixen.Editor.AssetEditors
- PrimitiveShapeTestsVixen.Editor.SceneView.Tests
- SceneEditorFactoryVixen.Editor.AssetEditors
- SceneFileWriterVixen.Editor.SceneView
- SceneFormatMigrationTestsVixen.Editor.SceneView.Tests
- SceneSerializerTestsVixen.Editor.SceneView.Tests