# BlobAssetReference<T>

> A reference to a blob asset stored in unmanaged memory.

## Definition

* **Type:** Struct
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule
* **Implements:** [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable), [IEquatable\<BlobAssetReference\<T>>](https://learn.microsoft.com/dotnet/api/system.iequatable-1)

```csharp
public struct BlobAssetReference<T> : IDisposable, IEquatable<BlobAssetReference<T>> where T : unmanaged
```

## Remarks

Create a blob asset using a [BlobBuilder](/engine/7000.0/script-reference/unity/entities/blobbuilder.md) or by deserializing a serialized blob asset.

## Properties

| Property                                                                                     | Description                                                                              |
| -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| [IsCreated](/engine/7000.0/script-reference/unity/entities/blobassetreference1/iscreated.md) | Reports whether this instance references a valid blob asset.                             |
| [Value](/engine/7000.0/script-reference/unity/entities/blobassetreference1/value.md)         | A reference to the blob asset data, a struct of type T that is stored in the blob asset. |

## Static Properties

| Property                                                                           | Description                                                                             |
| ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| [Null](/engine/7000.0/script-reference/unity/entities/blobassetreference1/null.md) | A "null" blob asset reference that can be used to test if a BlobAssetReference instance |

## Methods

| Method                                                                                             | Description                                                          |
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| [Dispose](/engine/7000.0/script-reference/unity/entities/blobassetreference1/dispose.md)           | Destroys the referenced blob asset and frees its memory.             |
| [Equals](/engine/7000.0/script-reference/unity/entities/blobassetreference1/equals.md)             | Two BlobAssetReferences are equal when they reference the same data. |
| [GetHashCode](/engine/7000.0/script-reference/unity/entities/blobassetreference1/gethashcode.md)   | Generates the hash code for this object.                             |
| [GetUnsafePtr](/engine/7000.0/script-reference/unity/entities/blobassetreference1/getunsafeptr.md) | Provides an unsafe pointer to the blob asset data.                   |

## Static Methods

| Method                                                                                   | Description                                                                                                          |
| ---------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| [Create](/engine/7000.0/script-reference/unity/entities/blobassetreference1/create.md)   | Creates a blob asset from an instance of a struct.                                                                   |
| [TryRead](/engine/7000.0/script-reference/unity/entities/blobassetreference1/tryread.md) | Reads bytes from a fileName, validates the expected serialized version, and deserializes them into a new blob asset. |
| [Write](/engine/7000.0/script-reference/unity/entities/blobassetreference1/write.md)     | Writes the blob data to a path with serialized version.                                                              |

## Operators

| Operator                                                                                           | Description                                                                |
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| [operator ==](/engine/7000.0/script-reference/unity/entities/blobassetreference1/op-equality.md)   | Two BlobAssetReferences are equal when they reference the same data.       |
| [operator !=](/engine/7000.0/script-reference/unity/entities/blobassetreference1/op-inequality.md) | Two BlobAssetReferences are not equal unless they reference the same data. |
