ToRigReference(Avatar)
Acquires a reference to the rig definition of an avatar.
Read time 1 minuteLast updated 4 hours ago
Definition
- Type: Method
- Namespace: Unity.Animations
- Assembly: UnityEngine.AnimationCoreModule
public static BlobObjectReference<RigDefinition> ToRigReference(this Avatar avatar)
Parameters
The avatar to get the rig definition from. Can be null.
Returns
Type | Description |
|---|---|
| BlobObjectReference<RigDefinition> | The reference to the RigDefinition of the avatar. Dispose the reference when you finish with it. BlobObjectReference<T>.IsValid is |
Remarks
Use this method to get the rig definition in a form that jobs and Burst-compiled code can read. The first call builds the rig definition from the avatar. The reference keeps the data alive until you dispose it, even if the avatar is destroyed or modified. Call this method from the main thread.
Only Generic avatars are supported. If is a Humanoid avatar, this method logs a warning once for the avatar and ignores the Humanoid mapping. The rig definition has a bone for each transform of the avatar.
avatar