Blend
Blends an input stream with the current stream using a blending value.
Read time 3 minutesLast updated 4 hours ago
Definition
- Type: Method
- Namespace: Unity.Animations
- Assembly: UnityEngine.AnimationCoreModule
Blend(AnimationStream, AnimationStream, float)
Blends an input stream with the current stream using a blending value.
public static void Blend(this ref AnimationStream stream, in AnimationStream input, float weight)
Parameters
The stream to modify. The method stores the result in this stream.
The stream to blend.
The weight of the input stream in the blend.
Remarks
If is greater than 0, the method sets the pass and frame flags of the channels that sets. If is 0 or less, the flags of the stream don't change. Flags that are already set in the stream stay set.
weightinputweightBlend(AnimationStream, AnimationStream, float, AnimationStreamMask)
Blends an input stream with the current stream using a blending value and weight masks.
public static void Blend(this ref AnimationStream stream, in AnimationStream input, float weight, in AnimationStreamMask mask)
Parameters
The stream to modify. The method stores the result in this stream.
The stream to blend.
The weight of the input stream in the blend.
The mask that scales the weight of each channel.
Remarks
The method sets the pass and frame flags of a channel that sets only if the weight of the channel in , multiplied by , is greater than 0. Channels with a combined weight of 0 keep their flags. Flags that are already set in the stream stay set.
inputmaskweightBlend(AnimationStream, AnimationStream, AnimationStream, float)
Blends two input streams using a blending weight value and stores the result in the animation stream.
public static void Blend(this ref AnimationStream stream, in AnimationStream input1, in AnimationStream input2, float weight)
Parameters
The stream that receives the result. The method overwrites its previous contents.
The first stream to blend.
The second stream to blend.
The weight of in the blend.
input2Remarks
The pass and frame flags of the stream are the flags of , plus the flags of if is greater than 0. Because the method always keeps the flags of , a channel stays flagged even when is 1.
input1input2weightinput1weightBlend(AnimationStream, AnimationStream, AnimationStream, float, AnimationStreamMask)
Blends two input streams using a blending weight value and weight masks. The result is stored in the animation stream.
public static void Blend(this ref AnimationStream stream, in AnimationStream input1, in AnimationStream input2, float weight, in AnimationStreamMask mask)
Parameters
The stream that receives the result. The method overwrites its previous contents.
The first stream to blend.
The second stream to blend.
The weight of in the blend.
input2The mask that scales the weight of each channel.
Remarks
The pass and frame flags of the stream are the flags of , plus the flags of for the channels where the weight of the channel in , multiplied by , is greater than 0. Channels with a combined weight of 0 get only the flags of . The method always keeps the flags of , so a channel stays flagged even when its combined weight is 1.
input1input2maskweightinput1input1