Component:ReferenceCopy

From Resonite Wiki
This page contains changes which are not marked for translation.
Component image 
Reference Copy`1 component as seen in the Scene Inspector

The ReferenceCopy component is used to copy one reference to another place, driving the target with an write back option.

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.
Source direct RelayRef`1<SyncRef`1<T>> The source to copy the Reference from
Target direct RefDrive`1<T> The target to drive to the value of Source
WriteBack Bool whether to allow changes done to Target to change Source.

Usage

Drives the target's reference with the source's reference. When using WriteBack, changes made to the Target are local while editing it. When the user is done setting it, it writes via a network sync to change the Source reference. If the Source and Target are the same, the reference will be completely local, and no network sync happens when changing the reference. When using the ReferenceCopy to make fields local like this, joining users will have the host's reference by default.

Examples

ReferenceCopy Example A ReferenceField<slot>'s Reference is being self driven with a WriteBack - making the Reference local, and still changeable. Changes to this reference will be local.

ReferenceCopy Example A ReferenceField<slot>'s Reference is being driven to be "hello" from another ReferenceField<slot>'s Reference. The one in pink is the one being driven.


See Also