Class CinemachineBlend
Describes a blend between 2 Cinemachine Virtual Cameras, and holds the current state of the blend.
Inheritance
Namespace: Cinemachine
Syntax
public class CinemachineBlend
Constructors
CinemachineBlend(ICinemachineCamera, ICinemachineCamera, AnimationCurve, Single, Single)
Construct a blend
Declaration
public CinemachineBlend(ICinemachineCamera a, ICinemachineCamera b, AnimationCurve curve, float duration, float t)
Parameters
Type | Name | Description |
---|---|---|
ICinemachineCamera | a | First camera |
ICinemachineCamera | b | Second camera |
AnimationCurve | curve | Blend curve |
System.Single | duration | Duration of the blend, in seconds |
System.Single | t | Current time in blend, relative to the start of the blend |
Properties
BlendCurve
The curve that describes the way the blend transitions over time from the first camera to the second. X-axis is normalized time (0...1) over which the blend takes place and Y axis is blend weight (0..1)
Declaration
public AnimationCurve BlendCurve { get; set; }
Property Value
Type | Description |
---|---|
AnimationCurve |
BlendWeight
The current weight of the blend. This is an evaluation of the BlendCurve at the current time relative to the start of the blend. 0 means camA, 1 means camB.
Declaration
public float BlendWeight { get; }
Property Value
Type | Description |
---|---|
System.Single |
CamA
First camera in the blend
Declaration
public ICinemachineCamera CamA { get; set; }
Property Value
Type | Description |
---|---|
ICinemachineCamera |
CamB
Second camera in the blend
Declaration
public ICinemachineCamera CamB { get; set; }
Property Value
Type | Description |
---|---|
ICinemachineCamera |
Description
Text description of the blend, for debugging
Declaration
public string Description { get; }
Property Value
Type | Description |
---|---|
System.String |
Duration
Duration in seconds of the blend.
Declaration
public float Duration { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
IsComplete
True if the time relative to the start of the blend is greater than or equal to the blend duration
Declaration
public bool IsComplete { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsValid
Validity test for the blend. True if either camera is defined.
Declaration
public bool IsValid { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
State
Compute the blended CameraState for the current time in the blend.
Declaration
public CameraState State { get; }
Property Value
Type | Description |
---|---|
CameraState |
TimeInBlend
The current time relative to the start of the blend
Declaration
public float TimeInBlend { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Methods
UpdateCameraState(Vector3, Single)
Make sure the source cameras get updated.
Declaration
public void UpdateCameraState(Vector3 worldUp, float deltaTime)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | worldUp | Default world up. Individual vcams may modify this |
System.Single | deltaTime | Time increment used for calculating time-based behaviours (e.g. damping) |
Uses(ICinemachineCamera)
Does the blend use a specific Cinemachine Virtual Camera?
Declaration
public bool Uses(ICinemachineCamera cam)
Parameters
Type | Name | Description |
---|---|---|
ICinemachineCamera | cam | The camera to test |
Returns
Type | Description |
---|---|
System.Boolean | True if the camera is involved in the blend |