Documentation

Unity Engine

Download Unity

Unity Engine

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

public ClipSampler Clone()

Returns

Type

Description

ClipSamplerThe 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.