struct in Unity.Entities
Implements interfaces:IIndexable<T0>, INativeList<T0>, IQueryTypeParameter
An array-like data structure that can be used as a component.
| Property | Description |
|---|---|
| Capacity | The number of elements the buffer can hold. |
| IsCreated | Whether the memory for this dynamic buffer has been allocated. |
| IsEmpty | Reports whether container is empty. |
| Length | The number of elements the buffer holds. |
| this[int] | Array-like indexing operator. |
| Method | Description |
|---|---|
| Add | Adds an element to the end of the buffer, resizing as necessary. |
| AddRange | Adds all the elements from newElems to the end of the buffer, resizing as necessary. |
| AsNativeArray | Return a native array that aliases the original buffer contents. |
| Clear | Sets the buffer length to zero. |
| CopyFrom | Copies all the elements from the specified native array into this dynamic buffer. |
| ElementAt | Gets the reference to the element at the given index. |
| EnsureCapacity | Ensures that the buffer has at least the specified capacity. |
| GetEnumerator | Provides an enumerator for iterating over the buffer elements. |
| GetUnsafePtr | Gets an unsafe read/write pointer to the contents of the buffer. |
| GetUnsafeReadOnlyPtr | Gets an unsafe read-only pointer to the contents of the buffer. |
| Insert | Inserts an element at the specified index, resizing as necessary. |
| Reinterpret | Returns a dynamic buffer of a different type, pointing to the same buffer memory. |
| RemoveAt | Removes the element at the specified index. |
| RemoveAtSwapBack | Removes the element at the specified index and swaps the last element into its place. This is more efficient than moving all elements following the removed element, but does change the order of elements in the buffer. |
| RemoveRange | Removes the specified number of elements, starting with the element at the specified index. |
| RemoveRangeSwapBack | Removes the specified number of elements, starting with the element at the specified index. It replaces the elements that were removed with a range of elements from the back of the buffer. This is more efficient than moving all elements following the removed elements, but does change the order of elements in the buffer. |
| Resize | Sets the length of this buffer, increasing the capacity if necessary. |
| ResizeUninitialized | Sets the length of this buffer, increasing the capacity if necessary. |
| ToNativeArray | Copies the buffer into a new native array. |
| TrimExcess | Removes any excess capacity in the buffer. |