Component:SpawnOrDestroy: Difference between revisions

From Resonite Wiki
Automated: update Fields
add info
 
Line 3: Line 3:
|Name=Spawn Or Destroy
|Name=Spawn Or Destroy
}}
}}
{{stub}}
The '''SpawnOrDestroy''' component is part of the [[Undo]] system, and handles spawning and destruction of objects in the [[Undo]] system.


== Usage ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|Target|Worker|
|Target|Worker| The target worker to use when executing.
|TargetParent|Slot|
|TargetParent|Slot| The parent of this object to restore it to.
|_onRestored|{{RootFieldType|SyncDelegate`1|[[Type:Action`1|Action`1]]<[[Type:Worker|Worker]]>}}|TypeAdv2=true|
|_onRestored|{{RootFieldType|SyncDelegate`1|[[Type:Action`1|Action`1]]<[[Type:Worker|Worker]]>}}|TypeAdv2=true| The sync delegate with this compoonent's worker passed as an object to trigger when the object is restored.
|_mode|'''[[#Mode|SpawnOrDestroy.Mode]]'''|TypeAdv3=true|
|_mode|'''[[#Mode|SpawnOrDestroy.Mode]]'''|TypeAdv3=true| What mode to execute.
|_preserveAssets|Bool|
|_preserveAssets|Bool| Whether the destruction should preserve assets like meshes.
|_sendDestroyingEvents|Bool|
|_sendDestroyingEvents|Bool| Whether to send destruction events when destroying.
|_savedObject|Uri|
|_savedObject|Uri| The URI of the saved object.
|_isComponent|Bool|
|_isComponent|Bool| Whether this is in component form or internal to the engine.
|_referenceTable|'''[[Component:SavedReferenceTable|SavedReferenceTable]]'''|TypeAdv8=true|
|_referenceTable|'''[[Component:SavedReferenceTable|SavedReferenceTable]]'''|TypeAdv8=true| The place to store destroyed object data in order to restore the object later.
|_isSaving|Bool|
|_isSaving|Bool| Whether this component is saving object data.
|_description|String|
|_description|String| The description of the object.
|_performed|Bool|
|_performed|Bool| Whether this component is finished executing it's function.
}}
}}


== Behavior ==
== Usage ==


== Examples ==
== Examples ==
Used to restore objects destroyed via undoable protoflux actions or context menu, or for undoing spawning of objects.


== See Also ==
== See Also ==
Line 30: Line 31:
[[Category:Components{{#translation:}}|Spawn Or Destroy]]
[[Category:Components{{#translation:}}|Spawn Or Destroy]]
[[Category:Components With Nested Enums{{#translation:}}|Spawn Or Destroy]]
[[Category:Components With Nested Enums{{#translation:}}|Spawn Or Destroy]]
[[Category:ComponentStubs]]

Latest revision as of 03:38, 1 August 2025

Component image 
Spawn Or Destroy component as seen in the Scene Inspector

The SpawnOrDestroy component is part of the Undo system, and handles spawning and destruction of objects in the Undo system.

Fields

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled. Some components stop their functionality when this field is disabled, but some don't.
Target Worker The target worker to use when executing.
TargetParent Slot The parent of this object to restore it to.
_onRestored delegate of identity Action`1<Worker> The sync delegate with this compoonent's worker passed as an object to trigger when the object is restored.
_mode SpawnOrDestroy.Mode What mode to execute.
_preserveAssets Bool Whether the destruction should preserve assets like meshes.
_sendDestroyingEvents Bool Whether to send destruction events when destroying.
_savedObject Uri The URI of the saved object.
_isComponent Bool Whether this is in component form or internal to the engine.
_referenceTable SavedReferenceTable The place to store destroyed object data in order to restore the object later.
_isSaving Bool Whether this component is saving object data.
_description String The description of the object.
_performed Bool Whether this component is finished executing it's function.

Usage

Examples

Used to restore objects destroyed via undoable protoflux actions or context menu, or for undoing spawning of objects.

See Also