Documentation

Unity Engine

Download Unity

Unity Engine

CreateReadOnly

Creates a read-only AnimationStreamMask from a RigDefinition and a NativeArray of WeightData.
Read time 1 minuteLast updated 4 hours ago

Definition

CreateReadOnly(RigDefinition, NativeArray<WeightData>)

Creates a read-only AnimationStreamMask from a RigDefinition and a NativeArray of WeightData.
public static AnimationStreamMask CreateReadOnly(ref RigDefinition rig, NativeArray<WeightData> buffer)

Parameters

The rig definition that describes the layout of the weight data.

The NativeArray<T> of WeightData that the mask views. Its length must be BindingSet.StreamMaskSize.

Returns

Type

Description

AnimationStreamMaskA read-only AnimationStreamMask that views
buffer
. Returns a default mask if
rig
is a null reference or
buffer
is empty. If safety checks are disabled, also returns a default mask if
buffer
is shorter than BindingSet.StreamMaskSize.

CreateReadOnly(RigDefinition, WeightMaskSampler)

Creates a read-only AnimationStreamMask that reads the weights of a WeightMaskSampler.
public static AnimationStreamMask CreateReadOnly(ref RigDefinition rig, WeightMaskSampler weightMask)

Parameters

The rig definition that describes the layout of the weight data. It must be the rig that the sampler was created for.

The sampler that holds the weights.

Returns

Type

Description

AnimationStreamMaskThe read-only mask. A default mask if
rig
or
weightMask
isn't created.

Remarks

The mask is a view of the memory of the sampler and uses the safety handle of the sampler. Disposing the mask doesn't release the memory of the sampler. If safety checks are enabled, using the mask after you dispose the sampler throws an
ObjectDisposedException
.