Unity Engine documentation Script Reference Unity.Collections NativeReference<T> An unmanaged single value.
Read time 1 minute
Last updated 7 days ago Definition
public struct NativeReference<T> : INativeDisposable, IDisposable, IEquatable<NativeReference<T>> where T : unmanaged
The functional equivalent of an array of length 1. When you need just one value, NativeReference can be preferable to an array because it better conveys the intent.
Constructors
Properties
Property Description IsCreated Whether this reference has been allocated (and not yet deallocated). Value The value stored in this reference.
Methods
Method Description AsReadOnly Returns a read-only reference aliasing the value of this reference. CopyFrom Copy the value of another reference to this reference. CopyTo Copy the value of this reference to another reference. Dispose Releases all resources (memory and safety handles). Equals Returns true if the value stored in this reference is equal to an object. GetHashCode Returns the hash code of this reference.
Static Methods
Method Description Copy Copies the value of a reference to another reference.
Operators
Operator Description operator == Returns true if the values stored in two references are equal. ReadOnly Returns a read-only native reference that aliases the content of a native reference. operator != Returns true if the values stored in two references are unequal.
Structs
Struct Description NativeReference<T>.ReadOnly A read-only alias for the value of a NativeReference. Does not have its own allocated storage.