Vixen
02b45cc4
csharp
public static class SceneCompiler

Turns an authored scene into the one a player loads.

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

Remarks

The step [08](../../../docs/plan/08-asset-pipeline-and-addressables.md) calls the compile, and the seam it exists to keep. Import produces editor-domain objects and compile produces runtime-domain chunks: a SceneFile is a nested tree of named entities with tagged components, and a SceneContent is flat tables and archetype-ordered blobs. Everything the runtime does not need — the nesting, the names when a build strips them, the spelling of every number — is spent here, once, at build time.

Nothing is loaded into a world to compile it. The authored components arrive from the YAML binder already boxed, and a binder writes a boxed value straight into a column — so a content build never constructs an ECS world, an archetype or an entity. That matters because a build compiles every scene in a project, in parallel worker processes, and a world per scene would be the largest thing in each of them.

Deterministic, because doc 12 gates the build on it. Entities are numbered by the same depth-first walk the file is written in, blocks are ordered by their component names, entities within a block are ascending, and columns are in name order. Two builds of one scene on two operating systems produce the same bytes, so an unchanged level ships nothing in a content update.

Fields and properties (1)

  • public const int Version

    What this compiler produces. Bumping it recompiles every scene in every project, which is what a change to the compiled layout needs.

Methods (3)

Used by (4)

  • CompiledSceneViewVixen.Editor.AssetEditors
  • SceneImporterVixen.Editor.Assets
  • SceneImporterTestsVixen.Editor.Assets.Tests
  • SceneRenderComponentTestsVixen.Editor.Assets.Tests