Skip to content

ComponentDef

Defined in: ecs/component.ts:218

A component type, as defineComponent returns it. Pass it to queries, world.get/world.insert and Commands; the reflection members below are what the editor and the asset cook read, derived from the metadata given at definition. The underscored members are engine plumbing.

T

readonly animatableFields: readonly string[]

Defined in: ecs/component.ts:231


readonly assetFields: readonly AssetFieldMeta[]

Defined in: ecs/component.ts:227


readonly colorKeys: readonly string[]

Defined in: ecs/component.ts:230


readonly optional discoverAssets?: (data) => AssetRef[]

Defined in: ecs/component.ts:237

Record<string, unknown>

AssetRef[]


readonly entityFields: readonly string[]

Defined in: ecs/component.ts:229


readonly fieldMeta: Readonly<Record<string, FieldMeta>>

Defined in: ecs/component.ts:236


readonly readonlyFields: readonly string[]

Defined in: ecs/component.ts:235

Engine-computed output fields the editor must never write back. See ComponentMetadata.readonlyFields.


readonly renderableField: string | null

Defined in: ecs/component.ts:242

Bool field gating this component’s visibility, or null if it draws nothing. See ComponentMetadata.renderableField.


readonly replicatedFields: readonly string[]

Defined in: ecs/component.ts:233

Fields the replication layer syncs; empty = never replicates. See ComponentMetadata.replicatedFields.


readonly optional skeletalFields?: SkeletalFieldMeta

Defined in: ecs/component.ts:228


readonly transient: boolean

Defined in: ecs/component.ts:239

Runtime-only: omitted from scene serialization. See ComponentMetadata.transient.

create(data?): T

Defined in: ecs/component.ts:243

Partial<T>

T