Component:ReferenceField: Difference between revisions

From Resonite Wiki
add info
add more
 
Line 2: Line 2:
<translate>
<translate>
<!--T:1-->
<!--T:1-->
Reference Field is a component that is able to store a reference for later use, as long as the reference still exists by then. This can be used in tandem with a [[Component:ReferenceGrabReceiver|Reference Grab Receiver Component]] as a place to store the value received by said component. This component's <code>Reference</code> field can be accessed with ProtoFlux. Using this as a [[ProtoFlux:Data Model Store|Data Model Store]] is considered bad practice due to it making your code harder to read, use, and transfer.
{{Infobox Component
{{Infobox Component
|Image=ReferenceField`1Component.png
|Image=ReferenceField`1Component.png
|Name=Reference Field`1
|Name=Reference Field
}}
}}
Reference Field is a component that is able to store a reference for later use, as long as the reference still exists by then.


<!--T:2-->
<!--T:2-->
Line 16: Line 16:
<!--T:3-->
<!--T:3-->
== Usage ==
== Usage ==
This can be used in tandem with a [[Component:ReferenceGrabReceiver|Reference Grab Receiver Component]] as a place to store the value received by said component. This component's <code>Reference</code> field can be accessed with ProtoFlux.
Using this as a [[ProtoFlux:Data Model Store|Data Model Store]] is considered bad practice due to it making your code harder to read, use, and transfer.


<!--T:4-->
<!--T:4-->
== Examples ==
== Examples ==
{{stub}}


<!--T:5-->
<!--T:5-->
== Related Components ==
== See Also ==
* [[Component:ValueField`1]]
</translate>
</translate>
[[Category:Generics{{#translation:}}]]
[[Category:Generics{{#translation:}}]]

Latest revision as of 17:53, 27 January 2025

Component image 
Reference Field component as seen in the Scene Inspector

Reference Field is a component that is able to store a reference for later use, as long as the reference still exists by then.

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.
Reference T A field that can be used to store any reference type.

Usage

This can be used in tandem with a Reference Grab Receiver Component as a place to store the value received by said component. This component's Reference field can be accessed with ProtoFlux.

Using this as a Data Model Store is considered bad practice due to it making your code harder to read, use, and transfer.

Examples

This article or section is a Stub. You can help the Resonite Wiki by expanding it.


See Also