Vixen
02b45cc4
csharp
public interface IComponentBridge

One kind of component, as something a panel can ask about by name.

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

Remarks

⚠ An archetype knows dense ids and a panel knows names, and the map only goes one way. A ComponentTypeId is handed out in first-touch order, so it means nothing across two runs of the same program and cannot be shown to anybody. There is therefore no "what components does this entity have" call: an inspector enumerates the bridges it was given and asks each one Has.

⚠ Two kinds of component exist in the editor and both have to appear. One carries [Component] and [DataContract], so the engine's component generator declares it to SceneComponentRegistry and a compiled scene can name it; the other — Light, PrimitiveShape — is editor-side and deliberately written as its own field of the scene file, because a scene naming a type no build declares is what a content compile refuses. An inspector that showed only the first would omit the light on the light, which is the most obviously missing row in the panel.

Fields and properties (4)

  • AuthoringKind Kind

    Which of the two kinds of authoring unit this is.

  • string Name

    What it is called in a file: the serializer's alias, and its identity here.

  • string DisplayName

    What a person reads: the foldout's title and the Add Component menu's line.

  • Type ComponentType

    The CLR type, which is what the rows are drawn from.

Methods (5)

  • bool Has(World world, Entity entity)

    Whether an entity carries one.

  • object Read(World world, Entity entity)

    Reads it off an entity, boxed.

  • void Write(World world, Entity entity, object value)

    Puts a value on an entity, adding the component if it is not there.

  • object Create()

    A fresh one, for adding a component that was not there.

  • bool Remove(World world, Entity entity)

    Takes it off an entity.

Used by (14)

  • AddComponentMenuVixen.Editor.App
  • AddComponentMenuTestsVixen.Editor.App.Tests
  • BehaviorAuthoringTestsVixen.Editor.App.Tests
  • BehaviorBridgeVixen.Editor.SceneView
  • ComponentBridgeVixen.Editor.SceneView
  • ComponentGizmosVixen.Editor.SceneView
  • ComponentTestsVixen.Editor.App.Tests
  • ComponentsViewVixen.Editor.App
  • EditorApplicationVixen.Editor.App
  • EntryVixen.Editor.App
  • IconContributionTestsVixen.Editor.App.Tests
  • RegisteredVixen.Editor.App
  • SceneComponentBridgeVixen.Editor.SceneView
  • SetComponentCommandVixen.Editor.SceneView