Struct BlobArray<T>
An immutable array of value types stored in a blob asset.
Namespace: Unity.Entities
Syntax
public struct BlobArray<T>
where T : struct
Type Parameters
Name | Description |
---|---|
T | The data type of the elements in the array. Must be a struct or other value type. |
Remarks
When creating a blob asset, use the BlobBuilderArray<T> provided by a BlobBuilder instance to set the array elements.
Properties
Item[Int32]
The element of the array at the index
position.
Declaration
public T this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The array index. |
Property Value
Type | Description |
---|---|
T |
Remarks
The array element is a reference return.
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException | Thrown if |
Length
The number of elements in the array.
Declaration
public int Length { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
GetUnsafePtr()
Provides an unsafe pointer to the array data.
Declaration
public void *GetUnsafePtr()
Returns
Type | Description |
---|---|
Void* | An unsafe pointer. |
Remarks
You can only use unsafe pointers in
ToArray()
Declaration
public T[] ToArray()
Returns
Type | Description |
---|---|
T[] |