Description
The Sequence
property of the SkinnedModelRenderer
class provides access to the SequenceAccessor
, allowing for direct playback of animation sequences. This property is particularly useful when you want to bypass the animation graph and play sequences directly. It is important to note that the UseAnimGraph
property must be disabled if the scene model has an animation graph, to ensure that the sequence playback functions correctly.
Usage
To use the Sequence
property, ensure that the UseAnimGraph
property is set to false
if the model has an animation graph. This will allow you to directly control and play animation sequences using the SequenceAccessor
.
Example
// Example of using the Sequence property
var skinnedModelRenderer = new SkinnedModelRenderer();
skinnedModelRenderer.UseAnimGraph = false; // Disable anim graph to use sequences
var sequence = skinnedModelRenderer.Sequence;
// Assuming 'sequence' is a valid sequence name
sequence.Play("walk"); // Play the 'walk' sequence directly