Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

DynamicBuffer<T0>.AsNativeArray

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

Declaration

public NativeArray<T> AsNativeArray();

Returns

NativeArray<T> A NativeArray view of this buffer.

Description

Return a native array that aliases the original buffer contents.

You can only access the native array as long as the the buffer memory has not been reallocated. Several dynamic buffer operations, such as DynamicBuffer<T0>.Add and DynamicBuffer<T0>.TrimExcess can result in buffer reallocation.