Component:ReferenceCast

From Resonite Wiki
(Redirected from ReferenceCast (Component))
This page contains changes which are not marked for translation.
Component image 
File:ReferenceCast`2Component.png
Reference Cast`2 component as seen in the Scene Inspector

The ReferenceCast component can be used to try to take a type and change it to another type. This performs a C# cast which requires the types to be compatible for casting to make a result.


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.
Source I The source type to convert
Target direct RefDrive`1<O> The target field. Casts Source to this fields type, and then uses the result to drive this field.
WriteBack Bool whether to allow changes to the Target to update Source instead of discarding the change.

Usage

This is a way of changing a type without using ProtoFlux. Attaching this component can be difficult, so you should be familiar with Complex Types in Components. Keep in mind this does a C# Cast, which does not work with many different conversions.

Examples

See Also