PrefabOverride
此内容尚不支持你的语言。
Defined in: prefab/types.ts:99
Override types applied to an entity in an instantiated prefab.
property— patch one field of one component. Requires: componentType, propertyName, value.name— change the entity’s name. Requires: value (string).visibility— change the entity’s visibility. Requires: value (boolean).parent— re-parent a prefab-origin entity within the instance. Requires: value = the new parent’s stablePrefabEntityId, ornullfor “under the instance root”. Structural: applied byexpandInstance/applyDeltaToSource(which own the id space), not byapplyOverrides. The instance root is never re-parented this way — its attach point is the instance entry’s ownparent.component_added— add a component only if not already present (idempotent insert). Requires: componentData. Use this for variants that want to augment the base without silently stomping existing data.component_replaced— upsert: replace the component’s data if the component already exists, or insert it if not. Requires: componentData. Use this when you explicitly want to override the base’s copy.component_removed— delete the component if present. Requires: componentType.metadata_set— set or replace one metadata key. Requires: metadataKey, value (any JSON-serialisable). Idempotent — applying twice is a no-op.metadata_removed— delete one metadata key if present. Requires: metadataKey.
Properties
Section titled “Properties”componentData?
Section titled “componentData?”
optionalcomponentData?:PrefabComponentData
Defined in: prefab/types.ts:115
componentType?
Section titled “componentType?”
optionalcomponentType?:string
Defined in: prefab/types.ts:111
metadataKey?
Section titled “metadataKey?”
optionalmetadataKey?:string
Defined in: prefab/types.ts:113
prefabEntityId
Section titled “prefabEntityId”prefabEntityId:
string
Defined in: prefab/types.ts:100
propertyName?
Section titled “propertyName?”
optionalpropertyName?:string
Defined in: prefab/types.ts:112
type:
"property"|"component_added"|"component_replaced"|"component_removed"|"name"|"visibility"|"parent"|"metadata_set"|"metadata_removed"
Defined in: prefab/types.ts:101
value?
Section titled “value?”
optionalvalue?:unknown
Defined in: prefab/types.ts:114