Class CinemachineBlend
Describes a blend between 2 CinemachineCameras, and holds the current state of the blend.
Inherited Members
Namespace: Unity.Cinemachine
Assembly: Unity.Cinemachine.dll
Syntax
public class CinemachineBlend
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 |
---|---|
AnimationCurve |
CamA
First camera in the blend
Declaration
public ICinemachineCamera CamA
Field Value
Type | Description |
---|---|
ICinemachineCamera |
CamB
Second camera in the blend
Declaration
public ICinemachineCamera CamB
Field Value
Type | Description |
---|---|
ICinemachineCamera |
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 |
CustomBlender
If non-null, the custom blender will be used to blend camera state.
If null, then CameraState.Lerp will be used.
Declaration
public CinemachineBlend.IBlender CustomBlender { get; set; }
Property Value
Type | Description |
---|---|
CinemachineBlend.IBlender |
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 |
---|---|
CameraState |
Methods
ClearBlend()
Clears all fields except CamB. This effectively cuts to the end of the blend
Declaration
public void ClearBlend()
CopyFrom(CinemachineBlend)
Copy contents of a blend
Declaration
public void CopyFrom(CinemachineBlend src)
Parameters
Type | Name | Description |
---|---|---|
CinemachineBlend | src | Copy fields from this blend |
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 CinemachineCamera?
Declaration
public bool Uses(ICinemachineCamera cam)
Parameters
Type | Name | Description |
---|---|---|
ICinemachineCamera | cam | The camera to test |
Returns
Type | Description |
---|---|
bool | True if the camera is involved in the blend |