Class CinemachineCore
A singleton that manages complete lists of CinemachineBrain and, Cinemachine Virtual Cameras, and the priority queue. Provides services to keeping track of whether Cinemachine Virtual Cameras have been updated each frame.
Namespace: Cinemachine
Syntax
public sealed class CinemachineCore
Fields
CameraCutEvent
This event will fire after a brain updates its Camera
Declaration
public static CinemachineBrain.BrainEvent CameraCutEvent
Field Value
| Type | Description |
|---|---|
| CinemachineBrain.BrainEvent |
CameraUpdatedEvent
This event will fire after a brain updates its Camera
Declaration
public static CinemachineBrain.BrainEvent CameraUpdatedEvent
Field Value
| Type | Description |
|---|---|
| CinemachineBrain.BrainEvent |
CurrentTimeOverride
If non-negative, cinemachine willuse this value whenever it wants current game time. Usage is for master timelines in manual update mode, for deterministic behaviour.
Declaration
public static float CurrentTimeOverride
Field Value
| Type | Description |
|---|---|
| Single |
GetBlendOverride
Delegate for overriding a blend that is about to be applied to a transition. A handler can either return the default blend, or a new blend specific to current conditions.
Declaration
public static CinemachineCore.GetBlendOverrideDelegate GetBlendOverride
Field Value
| Type | Description |
|---|---|
| CinemachineCore.GetBlendOverrideDelegate |
GetInputAxis
Delegate for overriding Unity's default input system. If you set this, then your delegate will be called instead of System.Input.GetAxis(axisName) whenever in-game user input is needed.
Declaration
public static CinemachineCore.AxisInputDelegate GetInputAxis
Field Value
| Type | Description |
|---|---|
| CinemachineCore.AxisInputDelegate |
kStreamingVersion
Data version string. Used to upgrade from legacy projects
Declaration
public static readonly int kStreamingVersion
Field Value
| Type | Description |
|---|---|
| Int32 |
kVersionString
Human-readable Cinemachine Version
Declaration
public static readonly string kVersionString
Field Value
| Type | Description |
|---|---|
| String |
sShowHiddenObjects
If true, show hidden Cinemachine objects, to make manual script mapping possible.
Declaration
public static bool sShowHiddenObjects
Field Value
| Type | Description |
|---|---|
| Boolean |
UniformDeltaTimeOverride
If non-negative, cinemachine will update with this uniform delta time. Usage is for timelines in manual update mode.
Declaration
public static float UniformDeltaTimeOverride
Field Value
| Type | Description |
|---|---|
| Single |
Properties
BrainCount
Access the array of active CinemachineBrains in the scene
Declaration
public int BrainCount { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
CurrentTime
Replacement for Time.time, taking CurrentTimeTimeOverride into account.
Declaration
public static float CurrentTime { get; }
Property Value
| Type | Description |
|---|---|
| Single |
DeltaTime
Replacement for Time.deltaTime, taking UniformDeltaTimeOverride into account.
Declaration
public static float DeltaTime { get; }
Property Value
| Type | Description |
|---|---|
| Single |
Instance
Get the singleton instance
Declaration
public static CinemachineCore Instance { get; }
Property Value
| Type | Description |
|---|---|
| CinemachineCore |
VirtualCameraCount
List of all active Cinemachine Virtual Cameras for all brains. This list is kept sorted by priority.
Declaration
public int VirtualCameraCount { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Methods
FindPotentialTargetBrain(CinemachineVirtualCameraBase)
Try to find a CinemachineBrain to associate with a Cinemachine Virtual Camera. The first CinemachineBrain in which this Cinemachine Virtual Camera is live will be used. If none, then the first active CinemachineBrain with the correct layer filter will be used. Brains with OutputCamera == null will not be returned. Final result may be null.
Declaration
public CinemachineBrain FindPotentialTargetBrain(CinemachineVirtualCameraBase vcam)
Parameters
| Type | Name | Description |
|---|---|---|
| CinemachineVirtualCameraBase | vcam | Virtual camera whose potential brain we need. |
Returns
| Type | Description |
|---|---|
| CinemachineBrain | First CinemachineBrain found that might be appropriate for this vcam, or null |
GenerateCameraActivationEvent(ICinemachineCamera, ICinemachineCamera)
Signal that the virtual has been activated. If the camera is live, then all CinemachineBrains that are showing it will send an activation event.
Declaration
public void GenerateCameraActivationEvent(ICinemachineCamera vcam, ICinemachineCamera vcamFrom)
Parameters
| Type | Name | Description |
|---|---|---|
| ICinemachineCamera | vcam | |
| ICinemachineCamera | vcamFrom |
GenerateCameraCutEvent(ICinemachineCamera)
Signal that the virtual camera's content is discontinuous WRT the previous frame. If the camera is live, then all CinemachineBrains that are showing it will send a cut event.
Declaration
public void GenerateCameraCutEvent(ICinemachineCamera vcam)
Parameters
| Type | Name | Description |
|---|---|---|
| ICinemachineCamera | vcam |
GetActiveBrain(Int32)
Access the array of active CinemachineBrains in the scene without gebnerating garbage
Declaration
public CinemachineBrain GetActiveBrain(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | index | Index of the brain to access, range 0-BrainCount |
Returns
| Type | Description |
|---|---|
| CinemachineBrain | The brain at the specified index |
GetVirtualCamera(Int32)
Access the array of active ICinemachineCamera in the scene without gebnerating garbage
Declaration
public CinemachineVirtualCameraBase GetVirtualCamera(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | index | Index of the camera to access, range 0-VirtualCameraCount |
Returns
| Type | Description |
|---|---|
| CinemachineVirtualCameraBase | The virtual camera at the specified index |
IsLive(ICinemachineCamera)
Is this virtual camera currently actively controlling any Camera?
Declaration
public bool IsLive(ICinemachineCamera vcam)
Parameters
| Type | Name | Description |
|---|---|---|
| ICinemachineCamera | vcam |
Returns
| Type | Description |
|---|---|
| Boolean |