Documentation

Unity Engine


Unity Engine


RefRW<T>

RefRW stores a reference (with write access) to native memory
Read time 1 minuteLast updated a day ago

Definition

public readonly struct RefRW<T> : IQueryTypeParameter where T : struct, IComponentData

Constructors

Constructor

Description

RefRW`1(System.Byte*,Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle)Stores a safe reference a pointer to T
RefRW`1(Unity.Collections.NativeArray{`0},System.Int32)Stores a safe reference to a component from an array of components at the index.

Properties

Property

Description

IsValidChecks if the component exists on this entity.
ValueROReturns a read-only reference to the component value itself.
ValueRWReturns a writable reference to the component value itself.

Static Methods

Method

Description

OptionalStores a safe reference to a component from an array of components at the index. If the array is empty stores a null reference.