Reference Type: Difference between revisions

From Resonite Wiki
expand information about properties
clarify the csharp link
 
Line 13: Line 13:
* [[Value Type]]
* [[Value Type]]
* [[Type:Object]]
* [[Type:Object]]
* [https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/reference-types Microsoft documentation on C# Reference Types]
* [https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/reference-types Microsoft documentation on C# Reference Types]. Do note that this is ''not'' the same exact implementation as Resonite's reference types, but the concepts still apply.


[[Category:Type]]
[[Category:Type]]

Latest revision as of 00:37, 18 September 2024

Reference Types are a designation of types within the FrooxEngine Data Model. They are in contrast to value types in that they exist in one place in memory and are "passed around" by reference rather than by value, such as through a SyncRef<T>.

Reference types share the following properties:

Some examples of reference types include Slots, Users, Components, and Fields. Types defined through a struct are not reference types, such as the Rect type.

In general, the analogue to reference types in ProtoFlux is the object type. This can cause some confusion when using nodes that interact with FrooxEngine (such as Data Model Store) vs nodes that are contained entirely within protoflux (such as Store). A slot is an Object Ref in the Data Model, but an Object alone in ProtoFlux contexts. A string is a value in the Data Model, but an Object Field in ProtoFlux contexts.

See Also