PrefabInstanceSpec class
The data that makes a NodeSpec a prefab instance: a reference to another
.fscene plus the per-instance delta (overrides and added/removed
content). The prefab composer applies these against the referenced
document; a plain node leaves NodeSpec.instance null.
Constructors
-
PrefabInstanceSpec({required AssetRef source, LoadPolicy load = LoadPolicy.eager, List<
PropertyOverride> ? overrides, List<Attachment> ? attachments, List<LocalId> ? removedNodes, List<ComponentSpec> ? addedComponents, List<String> ? removedComponentTypes, List<MemberComponent> ? memberComponents}) -
Creates a prefab instance of
sourcewith an optional delta.
Properties
-
addedComponents
→ List<
ComponentSpec> -
Components added to the instance's root that the prefab does not have.
final
-
attachments
→ List<
Attachment> -
Host-scene nodes grafted into this instance under prefab-local parents.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- load → LoadPolicy
-
Whether the instance's content loads eagerly or streams in. Asset-backed
loaders resolve source relative to the declaring document for both
policies.
final
-
memberComponents
→ List<
MemberComponent> -
Components added to prefab member nodes on this instance, targeted by
the member's id in the prefab's own id space. Composed in before the
overrides, so an override can address their properties.
final
-
overrides
→ List<
PropertyOverride> -
Per-property overrides applied on top of the prefab.
final
-
removedComponentTypes
→ List<
String> -
Prefab component types suppressed on this instance's root.
final
-
removedNodes
→ List<
LocalId> -
Prefab nodes (by their local id in the prefab) suppressed on this
instance.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- source → AssetRef
-
The referenced prefab
.fscene.final
Methods
-
copyWith(
{AssetRef? source, LoadPolicy? load, List< PropertyOverride> ? overrides, List<Attachment> ? attachments, List<LocalId> ? removedNodes, List<ComponentSpec> ? addedComponents, List<String> ? removedComponentTypes, List<MemberComponent> ? memberComponents}) → PrefabInstanceSpec - A copy with the given fields replaced. Copy sites must use this (not a field-by-field reconstruction) so a new delta field is never dropped.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited