Clone()
Creates a sampler that samples the same clip for the same rig, with its own memory.
Read time 1 minuteLast updated 4 hours ago
Definition
- Type: Method
- Namespace: Unity.Animations
- Assembly: UnityEngine.AnimationCoreModule
public ClipSampler Clone()
Returns
Type | Description |
|---|---|
| ClipSampler | The new sampler. Dispose it when you finish with it. A default sampler if this sampler isn't created. |
Remarks
The clone copies the data that matches the curves of the clip with the rig, so it's much faster than AnimationClipExtensions.ToClipSampler. It acquires its own reference to the clip data and uses the allocator of this sampler.
The clone doesn't share memory with this sampler. Dispose it separately. You can use the clone after you dispose this sampler, and use the two samplers in different jobs at the same time. The clone starts with empty sampling caches, which doesn't change the values it samples.