Documentation

Unity Engine

Download Unity

Unity Engine

SetBlobAsset<T>(BlobObjectReference<T>, int)

Replaces the data stored in this object with a copy of the blob data of a reference.
Read time 1 minuteLast updated 3 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.AnimationModule
public void SetBlobAsset<T>(BlobObjectReference<T> reference, int version = 0) where T : unmanaged

Parameters

The reference to the blob data to copy. If it is invalid, the object becomes empty.

version

The version of the layout of
T
. To read the data back, pass the same version to
AcquireReference
. The default value is 0.

Remarks

The object stores a copy of the blob, so you can dispose
reference
after the call. The object also stores the type of
T
and the version, and BlobObject.AcquireReference returns a valid reference only for the same type and version.
To store a blob asset that you built with a
BlobBuilder
, copy it into a reference first with
BlobAssetReferenceExtensions.ToBlobObjectReference
.
Call this method from the main thread. References that you acquired earlier keep pointing to the previous data until you dispose them.