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.
Type Parameters
Section titled “Type Parameters”T
Properties
Section titled “Properties”animatableFields
Section titled “animatableFields”
readonlyanimatableFields: readonlystring[]
Defined in: ecs/component.ts:217
assetFields
Section titled “assetFields”
readonlyassetFields: readonlyAssetFieldMeta[]
Defined in: ecs/component.ts:213
colorKeys
Section titled “colorKeys”
readonlycolorKeys: readonlystring[]
Defined in: ecs/component.ts:216
discoverAssets?
Section titled “discoverAssets?”
readonlyoptionaldiscoverAssets?: (data) =>AssetRef[]
Defined in: ecs/component.ts:223
Parameters
Section titled “Parameters”Record<string, unknown>
Returns
Section titled “Returns”AssetRef[]
entityFields
Section titled “entityFields”
readonlyentityFields: readonlystring[]
Defined in: ecs/component.ts:215
fieldMeta
Section titled “fieldMeta”
readonlyfieldMeta:Readonly<Record<string,FieldMeta>>
Defined in: ecs/component.ts:222
readonlyFields
Section titled “readonlyFields”
readonlyreadonlyFields: readonlystring[]
Defined in: ecs/component.ts:221
Engine-computed output fields the editor must never write back. See ComponentMetadata.readonlyFields.
renderableField
Section titled “renderableField”
readonlyrenderableField:string|null
Defined in: ecs/component.ts:228
Bool field gating this component’s visibility, or null if it draws nothing. See ComponentMetadata.renderableField.
replicatedFields
Section titled “replicatedFields”
readonlyreplicatedFields: readonlystring[]
Defined in: ecs/component.ts:219
Fields the replication layer syncs; empty = never replicates. See ComponentMetadata.replicatedFields.
skeletalFields?
Section titled “skeletalFields?”
readonlyoptionalskeletalFields?:SkeletalFieldMeta
Defined in: ecs/component.ts:214
transient
Section titled “transient”
readonlytransient:boolean
Defined in: ecs/component.ts:225
Runtime-only: omitted from scene serialization. See ComponentMetadata.transient.
Methods
Section titled “Methods”create()
Section titled “create()”create(
data?):T
Defined in: ecs/component.ts:229
Parameters
Section titled “Parameters”Partial<T>
Returns
Section titled “Returns”T