Method Create
Create(Void*, Int32)
Creates a blob asset from a pointer to data and a specified size.
Declaration
public static BlobAssetReference<T> Create(void *ptr, int length)
Parameters
Type | Name | Description |
---|---|---|
Void* | ptr | A pointer to the buffer containing the data to store in the blob asset. |
Int32 | length | The length of the buffer in bytes. |
Returns
Type | Description |
---|---|
BlobAssetReference<T> | A reference to newly created blob asset. |
Remarks
The blob asset is created in unmanaged memory. Call Dispose() to free the asset memory when it is no longer needed. This function can only be used in an unsafe context.
See Also
Create(Byte[])
Creates a blob asset from a byte array.
Declaration
public static BlobAssetReference<T> Create(byte[] data)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | data | The byte array containing the data to store in the blob asset. |
Returns
Type | Description |
---|---|
BlobAssetReference<T> | A reference to newly created blob asset. |
Remarks
The blob asset is created in unmanaged memory. Call Dispose() to free the asset memory when it is no longer needed. This function can only be used in an unsafe context.
See Also
Create(T)
Creates a blob asset from an instance of a struct.
Declaration
public static BlobAssetReference<T> Create(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | An instance of |
Returns
Type | Description |
---|---|
BlobAssetReference<T> | A reference to newly created blob asset. |
Remarks
The struct must only contain blittable fields (primitive types, fixed-length arrays, or other structs meeting these same criteria). The blob asset is created in unmanaged memory. Call Dispose() to free the asset memory when it is no longer needed. This function can only be used in an unsafe context.