Class CinemachineBlend
Describes a blend between 2 Cinemachine Virtual Cameras, and holds the current state of the blend.
Inherited Members
Namespace: Cinemachine
Assembly: Cinemachine.dll
Syntax
public class CinemachineBlend
Constructors
CinemachineBlend(ICinemachineCamera, ICinemachineCamera, AnimationCurve, float, float)
Construct a blend
Declaration
public CinemachineBlend(ICinemachineCamera a, ICinemachineCamera b, AnimationCurve curve, float duration, float t)
Parameters
Type | Name | Description |
---|---|---|
ICinemachine |
a | First camera |
ICinemachine |
b | Second camera |
Animation |
curve | Blend curve |
float | duration | Duration of the blend, in seconds |
float | t | Current time in blend, relative to the start of the blend |
Fields
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
Field Value
Type | Description |
---|---|
Animation |
CamA
First camera in the blend
Declaration
public ICinemachineCamera CamA
Field Value
Type | Description |
---|---|
ICinemachine |
CamB
Second camera in the blend
Declaration
public ICinemachineCamera CamB
Field Value
Type | Description |
---|---|
ICinemachine |
Duration
Duration in seconds of the blend.
Declaration
public float Duration
Field Value
Type | Description |
---|---|
float |
TimeInBlend
The current time relative to the start of the blend
Declaration
public float TimeInBlend
Field Value
Type | Description |
---|---|
float |
Properties
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 |
---|---|
float |
Description
Text description of the blend, for debugging
Declaration
public string Description { get; }
Property Value
Type | Description |
---|---|
string |
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 |
---|---|
bool |
IsValid
Validity test for the blend. True if either camera is defined.
Declaration
public bool IsValid { get; }
Property Value
Type | Description |
---|---|
bool |
State
Compute the blended CameraState for the current time in the blend.
Declaration
public CameraState State { get; }
Property Value
Type | Description |
---|---|
Camera |
Methods
UpdateCameraState(Vector3, float)
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 |
float | 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 |
---|---|---|
ICinemachine |
cam | The camera to test |
Returns
Type | Description |
---|---|
bool | True if the camera is involved in the blend |