ドキュメント

Unity Engine

Download Unity

Unity Engine

AcquireReference<T>(int)

Acquires a reference that keeps the blob data stored in this object alive, even if the object is destroyed or its data is replaced.
読み終わるまでの所要時間 1 分最終更新 2日前

Definition

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

Parameters

version

The version of the layout of
T
that the stored data must have. The default value is 0. If the stored data has another version, the reference is invalid.

Returns

Type

Description

BlobObjectReference<T>The new reference. You must dispose it. The reference is invalid if the object is empty or stores another version of the blob.

Remarks

Use the reference to read the blob from jobs and from code that the Burst compiler compiles. This code can't access this object. Convert it with BlobObjectReference<T>.AsBlobAssetReference to read the data. The data stays valid until you dispose the reference.
Call this method from the main thread. The method doesn't throw when the object is empty or stores another version of the blob. Check BlobObjectReference<T>.IsValid before you use the reference.