Value Type: Difference between revisions

From Resonite Wiki
Added links.
cleanup
 
Line 6: Line 6:
What types are defined as value types in FrooxEngine are managed through a complicated autogenerated class called <code>Coder<T></code>. As such, it is much better to refer to the category for determining what is a value type in FrooxEngine.
What types are defined as value types in FrooxEngine are managed through a complicated autogenerated class called <code>Coder<T></code>. As such, it is much better to refer to the category for determining what is a value type in FrooxEngine.


It's simple to test whether a certain type is a value type or not. In the [[Scene Inspector]], fields holding a value type are easily identifiable by the ability to directly edit the value within them, rather than needing to drag in a reference to the type. A [[Component:ValueField|ValueField]] component is able to hold any FrooxEngine value type, which can be used as a quick reference to tell what is what.
In a[[Scene Inspector]], fields holding a value type are easily identifiable by the ability to directly edit the value within them, rather than needing to drag in a reference to the type.
 
A [[Component:ValueField|ValueField]] component is only able to be created for types that are FrooxEngine value types, so one can enter the type name to test whether it is a value type or not.


== In ProtoFlux ==
== In ProtoFlux ==
Line 24: Line 26:


== See Also ==
== See Also ==
* [[:Category:Value Types]]
* [[Reference Type]]
* [[Reference Type]]
* [[Type:Object]]
* [[Type:Object]]

Latest revision as of 00:32, 18 September 2024

A Value Type is a delegation of types within the FrooxEngine Data Model and ProtoFlux. In contrast to Reference Types, fields containing a value type store the value directly, rather than a reference to the value.

For a list of all value types in game, refer to Category:Value Types.

In FrooxEngine

What types are defined as value types in FrooxEngine are managed through a complicated autogenerated class called Coder<T>. As such, it is much better to refer to the category for determining what is a value type in FrooxEngine.

In aScene Inspector, fields holding a value type are easily identifiable by the ability to directly edit the value within them, rather than needing to drag in a reference to the type.

A ValueField component is only able to be created for types that are FrooxEngine value types, so one can enter the type name to test whether it is a value type or not.

In ProtoFlux

In ProtoFlux, in short, if a type can be classified as an unmanaged type in C#, it is recognized as a value type. Otherwise, it is an Object Type.

To expand on the definition, in ProtoFlux, an unmanaged type, or value type, must either (criteria not useful to Resonite excluded):

This discrepency between the definition of a value type in FrooxEngine and in ProtoFlux can cause some confusion. For example, a string is a value type in FrooxEngine, but an object type in ProtoFlux. This is also the case with nullable types.

In short, every value type in ProtoFlux is also a value type in FrooxEngine, but not every value type in FrooxEngine is a value type in ProtoFlux.

See Also