跳转到内容

ComponentDef

此内容尚不支持你的语言。

Defined in: ecs/component.ts:204

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:217


readonly assetFields: readonly AssetFieldMeta[]

Defined in: ecs/component.ts:213


readonly colorKeys: readonly string[]

Defined in: ecs/component.ts:216


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

Defined in: ecs/component.ts:223

Record<string, unknown>

AssetRef[]


readonly entityFields: readonly string[]

Defined in: ecs/component.ts:215


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

Defined in: ecs/component.ts:222


readonly readonlyFields: readonly string[]

Defined in: ecs/component.ts:221

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


readonly renderableField: string | null

Defined in: ecs/component.ts:228

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:219

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


readonly optional skeletalFields?: SkeletalFieldMeta

Defined in: ecs/component.ts:214


readonly transient: boolean

Defined in: ecs/component.ts:225

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

create(data?): T

Defined in: ecs/component.ts:229

Partial<T>

T