Class CinemachineSequencerCamera
This is a virtual camera "manager" that owns and manages a collection of child Virtual Cameras. When the camera goes live, these child vcams are enabled, one after another, holding each camera for a designated time. Blends between cameras are specified. The last camera is held indefinitely, unless the Loop flag is enabled.
Inheritance
Inherited Members
Namespace: Unity.Cinemachine
Assembly: Unity.Cinemachine.dll
Syntax
[DisallowMultipleComponent]
[ExecuteAlways]
[ExcludeFromPreset]
[AddComponentMenu("Cinemachine/Cinemachine Sequencer Camera")]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.cinemachine@3.1/manual/CinemachineSequencerCamera.html")]
public class CinemachineSequencerCamera : CinemachineCameraManagerBase, ICinemachineMixer, ICinemachineCamera
Fields
Instructions
The set of instructions for enabling child cameras
Declaration
[Tooltip("The set of instructions for enabling child cameras.")]
[FormerlySerializedAs("m_Instructions")]
public List<CinemachineSequencerCamera.Instruction> Instructions
Field Value
Type | Description |
---|---|
List<CinemachineSequencerCamera.Instruction> |
Loop
When enabled, the child vcams will cycle indefinitely instead of just stopping at the last one
Declaration
[Tooltip("When enabled, the child vcams will cycle indefinitely instead of just stopping at the last one")]
[FormerlySerializedAs("m_Loop")]
public bool Loop
Field Value
Type | Description |
---|---|
bool |
Methods
ChooseCurrentCamera(Vector3, float)
Choose the appropriate current camera from among the ChildCameras, based on current state. If the returned camera is different from the current camera, an appropriate transition will be made.
Declaration
protected override CinemachineVirtualCameraBase ChooseCurrentCamera(Vector3 worldUp, float deltaTime)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | worldUp | Default world Up, set by the CinemachineBrain |
float | deltaTime | Delta time for time-based effects (ignore if less than or equal to 0) |
Returns
Type | Description |
---|---|
CinemachineVirtualCameraBase | The current child camera that should be active. Must be present in ChildCameras. |
Overrides
LookupBlend(ICinemachineCamera, ICinemachineCamera)
Returns the current blend of the current instruction.
Declaration
protected override CinemachineBlendDefinition LookupBlend(ICinemachineCamera outgoing, ICinemachineCamera incoming)
Parameters
Type | Name | Description |
---|---|---|
ICinemachineCamera | outgoing | The camera we're blending from (ignored). |
ICinemachineCamera | incoming | The camera we're blending to (ignored). |
Returns
Type | Description |
---|---|
CinemachineBlendDefinition | The blend to use for this camera transition. |
Overrides
OnTransitionFromCamera(ICinemachineCamera, Vector3, float)
Notification that this virtual camera is going live.
Declaration
public override void OnTransitionFromCamera(ICinemachineCamera fromCam, Vector3 worldUp, float deltaTime)
Parameters
Type | Name | Description |
---|---|---|
ICinemachineCamera | fromCam | The camera being deactivated. May be null. |
Vector3 | worldUp | Default world Up, set by the CinemachineBrain |
float | deltaTime | Delta time for time-based effects (ignore if less than or equal to 0) |
Overrides
PerformLegacyUpgrade(int)
Override this to handle any upgrades necessitated by a streaming version change. Note that since this method is not called from the main thread, there are many things it cannot do, including checking a unity object for null.
Declaration
protected override void PerformLegacyUpgrade(int streamedVersion)
Parameters
Type | Name | Description |
---|---|---|
int | streamedVersion | The version that was streamed |
Overrides
Reset()
Reset the component to default values.
Declaration
protected override void Reset()
Overrides
UpdateCameraCache()
Rebuild the camera cache if it's been invalidated
Declaration
protected override bool UpdateCameraCache()
Returns
Type | Description |
---|---|
bool | True if a cache rebuild was performed, false if cache is up to date. |