Method TryAdd
TryAdd<T>(ref BlobAssetReference<T>)
Add a BlobAssetReference with the default hash key based on the BlobAsset contents itself. If the contents of the generated blob asset is the same as a previously inserted blob asset, then the passed blobAsset will be disposed and the reference to the blob asset will be replaced with the previously added blob asset
Declaration
public bool TryAdd<T>(ref BlobAssetReference<T> blobAsset)
where T : struct
Parameters
| Type | Name | Description |
|---|---|---|
| BlobAssetReference<T> | blobAsset | The blob asset that will be inserted or replaced |
Returns
| Type | Description |
|---|---|
| Boolean | Returns true if the blob asset was added, returns false if the blob asset was disposed and replaced with the previous blob. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of BlobAsset. |
TryAdd<T>(Hash128, ref BlobAssetReference<T>)
Add a BlobAssetReference with a custom hash key
Declaration
public bool TryAdd<T>(Hash128 customHash, ref BlobAssetReference<T> blobAsset)
where T : struct
Parameters
| Type | Name | Description |
|---|---|---|
| Hash128 | customHash | The key to be associated with the BlobAssetReference |
| BlobAssetReference<T> | blobAsset | The BlobAssetReference if found or default |
Returns
| Type | Description |
|---|---|
| Boolean | true if the BlobAssetReference was found, false if not found |
Type Parameters
| Name | Description |
|---|---|
| T | The type of BlobAsset |
TryAdd<T>(ref BlobAssetReference<T>, out Hash128)
Add a BlobAssetReference with the default hash key based on the BlobAsset contents itself. If the contents of the generated blob asset is the same as a previously inserted blob asset, then the passed blobAsset will be disposed and the reference to the blob asset will be replaced with the previously added blob asset
Declaration
public bool TryAdd<T>(ref BlobAssetReference<T> blobAsset, out Hash128 objectHash)
where T : struct
Parameters
| Type | Name | Description |
|---|---|---|
| BlobAssetReference<T> | blobAsset | The blob asset that will be inserted or replaced |
| Hash128 | objectHash | The hash that is based on the content of the BlobAsset |
Returns
| Type | Description |
|---|---|
| Boolean | Returns true if the blob asset was added, returns false if the blob asset was disposed and replaced with the previous blob. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of BlobAsset. |