
The ValueDriver<T> component continuously copies the value of the source IValue to the target field every update. The source and target types must be value types.
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. |
ValueSource
|
IValue`1<T> | The value field to get a value from. |
DriveTarget
|
field drive of T | The value field to set to the value of ValueSource.
|
Usage
This component ensures that the value in the DriveTarget is equal to the value in the ValueSource field. To do this, it drives the DriveTarget field to give it exclusive access to the value, then it starts writing the value from the ValueSource field to the target field every update.
This is distinct from ValueCopy, as it allows sourcing from IValue elements instead of just IField elements. It also does not have any WriteBack meachanism of any kind. Generally, ValueCopy should be used whenever possible, as it only updates the target field whenever the source field changes instead of every update.
See also
- Component:ValueCopy
- Component:ValueMultiDriver to form this relation to multiple target fields.