Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

NativeReference<T0>

struct in Unity.Collections


Implements interfaces:INativeDisposable

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

An unmanaged single value.

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.

Properties

Property Description
IsCreated Whether this reference has been allocated (and not yet deallocated).
Value The value stored in this reference.

Constructors

Constructor Description
NativeReference_1 Initializes and returns an instance of NativeReference.

Public 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 the value stored in another reference.
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 unequal.
operator == Returns true if the values stored in two references are equal.