ComponentMetadata
此内容尚不支持你的语言。
Defined in: ecs/component.ts:123
What a component declares about its fields beyond their default values: which are assets, which the editor may keyframe, which replicate. Optional throughout — a component that says nothing gets the derived defaults.
Properties
Section titled “Properties”animatableFields?
Section titled “animatableFields?”
optionalanimatableFields?:string[]
Defined in: ecs/component.ts:130
Keyframeable fields (Sequencer tracks); auto-derived from numeric fields if omitted.
assetFields?
Section titled “assetFields?”
optionalassetFields?:AssetFieldMeta[]
Defined in: ecs/component.ts:124
discoverAssets?
Section titled “discoverAssets?”
optionaldiscoverAssets?: (data) =>AssetRef[]
Defined in: ecs/component.ts:149
Custom asset discovery for scene preload. Authoritative when present:
assetFields are NOT walked for discovery (they still drive editor
pickers/ref rewrites), so the callback can exclude values that are not
asset refs (e.g. code-registered FSM/BT names).
Parameters
Section titled “Parameters”Record<string, unknown>
Returns
Section titled “Returns”AssetRef[]
entityFields?
Section titled “entityFields?”
optionalentityFields?:string[]
Defined in: ecs/component.ts:126
fields?
Section titled “fields?”
optionalfields?:Record<string,FieldMeta>
Defined in: ecs/component.ts:128
Per-field editor presentation policy, keyed by field name.
readonlyFields?
Section titled “readonlyFields?”
optionalreadonlyFields?:string[]
Defined in: ecs/component.ts:142
Engine-COMPUTED output fields (Transform’s world-space fields), authored
readonly at the C++ ES_PROPERTY site. Never authoring inputs — the editor
must not project them into the World (it clobbers the composed value).
renderableField?
Section titled “renderableField?”
optionalrenderableField?:string
Defined in: ecs/component.ts:166
The name of the bool field that gates this component’s part in an entity’s
visibility — set it and setEntityVisible, the editor’s eye and scene
sleep/wake all reach this component. Omitted = the component draws nothing.
Builtins author it at the C++ ES_COMPONENT(renderable=<field>) site.
replicatedFields?
Section titled “replicatedFields?”
optionalreplicatedFields?:string[]
Defined in: ecs/component.ts:136
Fields the network replication layer syncs (RC11). Whole-field granularity;
omitted = the component never replicates. Builtins author this at the C++
ES_PROPERTY site (replicated) instead — same single-source rule as fieldMeta.
skeletalFields?
Section titled “skeletalFields?”
optionalskeletalFields?:SkeletalFieldMeta
Defined in: ecs/component.ts:125
transient?
Section titled “transient?”
optionaltransient?:boolean
Defined in: ecs/component.ts:159
Runtime-only state that must never persist: a transient component is skipped by serializeScene (e.g. per-frame pointer/drag/hover state that its driving system rebuilds each frame). Systems still read/write it normally; only scene save omits it.
Builtins author this at the C++ ES_COMPONENT(transient) site — same
single-source rule as fieldMeta.