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.
Inheritance
Inherited Members
Namespace: Cinemachine
Syntax
public sealed class CinemachineCore
Fields
CameraUpdatedEvent
This event will fire after a brain updates its Camera
Declaration
public static CinemachineBrain.BrainEvent CameraUpdatedEvent
Field Value
| Type | Description |
|---|---|
| CinemachineBrain.BrainEvent |
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 |
|---|---|
| System.Int32 |
kVersionString
Human-readable Cinemachine Version
Declaration
public static readonly string kVersionString
Field Value
| Type | Description |
|---|---|
| System.String |
sShowHiddenObjects
If true, show hidden Cinemachine objects, to make manual script mapping possible.
Declaration
public static bool sShowHiddenObjects
Field Value
| Type | Description |
|---|---|
| System.Boolean |
Properties
BrainCount
Access the array of active CinemachineBrains in the scene
Declaration
public int BrainCount { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
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 |
|---|---|
| System.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 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)
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)
Parameters
| Type | Name | Description |
|---|---|---|
| ICinemachineCamera | vcam |
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 |
|---|---|---|
| System.Int32 | index | Index of the brain to access, range 0-BrainCount |
Returns
| Type | Description |
|---|---|
| CinemachineBrain | The brain at the specified index |
GetVcamUpdateStatus(ICinemachineCamera)
Internal use only
Declaration
public CinemachineCore.UpdateFilter GetVcamUpdateStatus(ICinemachineCamera vcam)
Parameters
| Type | Name | Description |
|---|---|---|
| ICinemachineCamera | vcam |
Returns
| Type | Description |
|---|---|
| CinemachineCore.UpdateFilter |
GetVirtualCamera(Int32)
Access the array of active ICinemachineCamera in the scene without gebnerating garbage
Declaration
public ICinemachineCamera GetVirtualCamera(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | Index of the camera to access, range 0-VirtualCameraCount |
Returns
| Type | Description |
|---|---|
| ICinemachineCamera | 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 |
|---|---|
| System.Boolean |