Property ValueRW
ValueRW
Returns a writable reference to the component value itself.
Declaration
public ref T ValueRW { get; }
Property Value
Type | Description |
---|---|
T |
Remarks
This value is a reference to the actual component data. It is safe to use this field directly, e.g. "Data.ValueRW.SomeField = 123". It is also safe to make a copy of this value, e.g. "var myComponent = Data.ValueRW". Keeping a ref ("ref var myref = Data.ValueRW" is inherently unsafe as any structural change may invalidate this reference, and there is no way to detect this. It is safe to use this reference locally if you can guarantee that no structural changes will occur in between acquiring it and using it. Do not hold on to such a reference for any extended amount of time.