public static class SceneComponentRegistryWhich component types a compiled scene is allowed to name, and how each of them loads.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Discovered at compile time, which is not the same as scanned at run time. A component carrying both [Component] and [DataContract] is declared here by ComponentRegistrationGenerator, through a [ModuleInitializer] the declaring assembly emits. The objection this paragraph used to record stands and is answered rather than dropped: an assembly scan reads metadata a trimmed publish has already deleted, and it would make "which components can be in a scene" a question with a different answer in the editor, in a worker process and in a shipped game. A generated call is the opposite — what is registered is what a generator saw in the source, so the set is fixed at build time and identical everywhere, which is the bargain SerializerRegistry already struck for the serializers themselves.
The name is the serializer's alias and is not chosen here. A component's [DataContract] name is already what the binary format writes for it; taking it from SerializerRegistry means there is one spelling rather than two that have to be kept in step, and it makes registering a type with no serializer fail at the registration rather than at the load.
⚠ Two attributes rather than one, because a handle is a component and is not scene data. PhysicsBody holds a body handle and carries [Component] without [DataContract], so it is excluded by construction — no denylist, no opt-out attribute, and nothing for anybody to remember. LocalTransform carries neither and is absent for its own reason: every entity in a scene has one, so it is stored as three columns of the scene's own rather than as a component somebody could also list, which would let a file say two different things about where an entity is.
Fields and properties (1)
public static IReadOnlyCollection<ISceneComponentBinder> BindersEvery component a scene may name, in the order they were registered.
Methods (6)
public static void Declare<T>()Says a component exists, to be registered the first time anything asks.
public static void Register<T>()Makes a component type nameable by a compiled scene.
public static bool TryGet(string alias, out ISceneComponentBinder? binder)The binder for a name, if a scene may name it.
public static bool TryGet(Type type, out ISceneComponentBinder? binder)The binder for a component type, if it has one.
public static ISceneComponentBinder Require(string alias)The binder for a name, or a failure that says what to do about it.
public static int Evict(Assembly assembly)Forgets every component an assembly declared.
Used by (18)
- ComponentRegistrationThirdPersonShooter
- ComponentRegistrationTestsVixen.Engine.Tests
- LightExtractionTestsVixen.Rendering.Tests
- PhysicsSceneComponentTestsVixen.Physics.Tests
- SceneAssetTestsVixen.Engine.Tests
- SceneBehaviorRegistryVixen.Engine
- SceneContentVixen.Engine
- WorldSerializerVixen.Engine
- WorldSerializerTestsVixen.Engine.Tests
- CompiledSceneTestsVixen.Editor.AssetEditors.Tests
- ComponentTestsVixen.Editor.App.Tests
- EditorApplicationVixen.Editor.App
- ProjectAssembliesVixen.Editor.App
- RegisteredVixen.Editor.App
- SceneCloneVixen.Editor.SceneView
- SceneCompilerVixen.Editor.Assets
- SceneImporterTestsVixen.Editor.Assets.Tests
- SceneSerializerVixen.Editor.SceneView