Component:ParentValueLink: Difference between revisions

From Resonite Wiki
Automated: create new component page
 
unstub
 
Line 1: Line 1:
{{Infobox Component
{{Infobox Component
|Image=ParentValueLink`1Component.png
|Image=ParentValueLink`1Component.png
|Name=Parent Value Link`1
|Name=ParentValueLink<float>
}}
}}
{{stub}}


== Usage ==
The '''ParentValueLink<T>''' component [[drives]] a [[field]] depending on the value of a compatible [[Component:ParentValue|ParentValue]] as part of a [[parent value]] system.
 
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|MatchTag|String|
|MatchTag|String|The tag to search for on the slot's immediate parent. Compatible [[Component:ParentValue|ParentValue]] components must have the same <code>Tag</code>.
|Target|{{RootFieldType|FieldDrive`1|T}}|TypeAdv1=true|
|Target|{{RootFieldType|RefDrive`1|T}}|TypeAdv1=true|The field to drive using the value of the linked parent.
|WriteBack|Bool|
|WriteBack|Bool|If <code>True</code>, any writes to the driven field will be propagated back to the <code>Value</code> provided by the ParentValue.
|DefaultValue|'''T'''|TypeAdv3=true|
|DefaultValue|'''T'''|TypeAdv3=true|Default value to use if the component can not find a compatible ParentValue.
}}
}}


== Behavior ==
== Usage ==
 
Upon a change of parent, this component will search for ParentValue components on the slot's immediate parent that have a matching type and tag. If it can find such a component and link to it, it will drive the <code>Target</code> field based on the <code>Value</code> of the ParentValue. If it can not find such a component, it will use the <code>DefaultValue</code> value.


== Examples ==
== Examples ==


== See Also ==
== See Also ==
* [[Component:ParentReferenceLink]], for [[reference types]]


[[Category:Components:Data:Parent{{#translation:}}|Parent Value Link`1]]
[[Category:Components:Data:Parent{{#translation:}}|Parent Value Link`1]]
[[Category:Components{{#translation:}}|Parent Value Link`1]]
[[Category:Components{{#translation:}}|Parent Value Link`1]]
[[Category:Generic Components{{#translation:}}|Parent Value Link`1]]
[[Category:Generic Components{{#translation:}}|Parent Value Link`1]]
[[Category:ComponentStubs]]

Latest revision as of 20:06, 18 December 2024

Component image 
ParentValueLink<float> component as seen in the Scene Inspector


The ParentValueLink<T> component drives a field depending on the value of a compatible ParentValue as part of a parent value 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.
MatchTag String The tag to search for on the slot's immediate parent. Compatible ParentValue components must have the same Tag.
Target direct RefDrive`1<T> The field to drive using the value of the linked parent.
WriteBack Bool If True, any writes to the driven field will be propagated back to the Value provided by the ParentValue.
DefaultValue T Default value to use if the component can not find a compatible ParentValue.

Usage

Upon a change of parent, this component will search for ParentValue components on the slot's immediate parent that have a matching type and tag. If it can find such a component and link to it, it will drive the Target field based on the Value of the ParentValue. If it can not find such a component, it will use the DefaultValue value.

Examples

See Also