public sealed class ComponentBridge<T> where T : structA bridge over a component this assembly knows the type of.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The typed half exists because World.Add, Read and Remove are generic — closing the generic once at construction keeps every call statically bound and boxes only at the boundary the panel actually needs a box at.
Fields and properties (4)
public AuthoringKind KindWhich of the two kinds of authoring unit this is.
public string NameWhat it is called in a file: the serializer's alias, and its identity here.
public string DisplayNameWhat a person reads: the foldout's title and the Add Component menu's line.
public Type ComponentTypeThe CLR type, which is what the rows are drawn from.
Methods (6)
public ComponentBridge(string name, Func<T>? initial = null, string? displayName = null)Describes a component.
public bool Has(World world, Entity entity)Whether an entity carries one.
public object Read(World world, Entity entity)Reads it off an entity, boxed.
public void Write(World world, Entity entity, object value)Puts a value on an entity, adding the component if it is not there.
public object Create()A fresh one, for adding a component that was not there.
public bool Remove(World world, Entity entity)Takes it off an entity.
Used by (1)
- ComponentGizmoTestsVixen.Editor.SceneView.Tests