Create
Creates a read-write AnimationStream from a RigDefinition and a NativeArray of AnimatedData.
Read time 2 minutesLast updated 4 hours ago
Definition
- Type: Method
- Namespace: Unity.Animations
- Assembly: UnityEngine.AnimationCoreModule
Create(RigDefinition, NativeArray<AnimatedData>)
Creates a read-write AnimationStream from a RigDefinition and a NativeArray of AnimatedData.
public static AnimationStream Create(ref RigDefinition rig, NativeArray<AnimatedData> buffer)
Parameters
The rig definition that describes the layout of the animated data in .
bufferThe NativeArray<T> of AnimatedData that the stream views. Its length must equal BindingSet.StreamSize.
Returns
Type | Description |
|---|---|
| AnimationStream | A read-write AnimationStream. Returns a default stream if |
Remarks
The stream is a view of and uses its safety handle. If safety checks are enabled, using the stream after you dispose the array throws an . Disposing the stream doesn't dispose the array.
bufferObjectDisposedExceptionCreate(RigDefinition, Allocator)
Creates a read-write AnimationStream that allocates and owns its buffer.
public static AnimationStream Create(ref RigDefinition rig, Allocator allocator)
Parameters
The rig definition that describes the layout of the animated data.
Returns
Type | Description |
|---|---|
| AnimationStream | A read-write AnimationStream. Returns a default stream if |
Remarks
The method fills the buffer, which holds BindingSet.StreamSize elements, with the default values of the rig, and clears the channel masks. Call AnimationStream.Dispose to free the buffer, for example with a statement. If safety checks are enabled, any copy of the stream throws an when you use it after you dispose the stream.
usingObjectDisposedException