Documentation

Unity Engine

Download Unity

Unity Engine

Add(ref AnimationStream, in AnimationStream, float)

Adds a weighted animation stream to the mix.
Read time 1 minuteLast updated 4 hours ago

Definition

Add(AnimationStream, AnimationStream, float)

public void Add(ref AnimationStream output, in AnimationStream add, float weight)

Parameters

The stream that accumulates the mixed result. Use the same stream as in the call to Core.PoseMixer.Begin.

The stream to add to the mix. It must use the same rig as
output
.

weight

The weight of the stream in the mix. The mixer doesn't normalize weights.

Remarks

The method scales each continuous channel by
weight
and adds it to the output stream. Rotations are scaled and summed the same way, and
End
normalizes them. The discrete channels, such as integers and entity IDs, come from the stream with the greatest weight. The default pose that
End
adds takes part in this choice. Its weight is 1 minus the sum of all weights. For example, with the weights 0.1, 0.2, and 0.3, the default pose has the weight 0.4, so its discrete channels are used. If several streams have the same greatest weight, the stream that you added first is used.