Cinemachine
CinemachineMixingCamera Class |
CinemachineMixingCamera is a "manager camera" that takes on the state of
the weighted average of the states of its child virtual cameras.
A fixed number of slots are made available for cameras, rather than a dynamic array.
We do it this way in order to support weight animation from the Timeline.
Timeline cannot animate array elements.
Inheritance Hierarchy
SystemObject Object
Component
Behaviour
MonoBehaviour
CinemachineCinemachineVirtualCameraBase
CinemachineCinemachineMixingCamera
Component
Behaviour
MonoBehaviour
CinemachineCinemachineVirtualCameraBase
CinemachineCinemachineMixingCamera
Namespace: Cinemachine
Assembly: Cinemachine (in Cinemachine.dll) Version: 2.0.0.0 (2.0.0.0)
Syntax
[DocumentationSortingAttribute(20f, DocumentationSortingAttributeLevel.UserRef)] [ExecuteInEditMode] [DisallowMultipleComponent] [AddComponentMenu("Cinemachine/CinemachineMixingCamera")] public class CinemachineMixingCamera : CinemachineVirtualCameraBase
Cinemachine.CinemachineMixingCamera = function(); Type.createClass( 'Cinemachine.CinemachineMixingCamera', Cinemachine.CinemachineVirtualCameraBase);
The CinemachineMixingCamera type exposes the following members.
Constructors
Name | Description | |
---|---|---|
CinemachineMixingCamera |
Properties
Name | Description | |
---|---|---|
ChildCameras | Get the cached list of child cameras.
These are just the immediate children in the hierarchy.
Note: only the first entries of this list participate in the
final blend, up to MaxCameras | |
Description | Gets a brief debug description of this virtual camera, for use when displayiong debug info (Inherited from CinemachineVirtualCameraBase.) | |
Follow | Not used (Overrides CinemachineVirtualCameraBaseFollow.) | |
LiveChildOrSelf | Return the live child. (Overrides CinemachineVirtualCameraBaseLiveChildOrSelf.) | |
LookAt | Not used (Overrides CinemachineVirtualCameraBaseLookAt.) | |
Name | Get the name of the Virtual Camera. Base implementation
returns the owner GameObject's name. (Inherited from CinemachineVirtualCameraBase.) | |
ParentCamera | Support for meta-virtual-cameras. This is the situation where a
virtual camera is in fact the public face of a private army of virtual cameras, which
it manages on its own. This method gets the VirtualCamera owner, if any.
Private armies are implemented as Transform children of the parent vcam. (Inherited from CinemachineVirtualCameraBase.) | |
PreviousStateIsValid | Set this to force the next update to ignore deltaTime and reset itself (Inherited from CinemachineVirtualCameraBase.) | |
Priority | Get the Priority of the virtual camera. This determines its placement
in the CinemachineCore's queue of eligible shots. (Inherited from CinemachineVirtualCameraBase.) | |
State | The blended CameraState (Overrides CinemachineVirtualCameraBaseState.) | |
ValidatingStreamVersion | Version that was last streamed, for upgrading legacy (Inherited from CinemachineVirtualCameraBase.) | |
VirtualCameraGameObject | The GameObject owner of the Virtual Camera behaviour. (Inherited from CinemachineVirtualCameraBase.) |
Methods
Name | Description | |
---|---|---|
AddPostPipelineStageHook |
A delegate to hook into the state calculation pipeline.
This will be called after each pipeline stage, to allow others to hook into the pipeline.
See CinemachineCore.Stage.
(Inherited from CinemachineVirtualCameraBase.) | |
GetWeight(Int32) | Get the weight of the child at an index. | |
GetWeight(CinemachineVirtualCameraBase) | Get the weight of the child CinemachineVirtualCameraBase. | |
InvalidateListOfChildren | Invalidate the cached list of child cameras. | |
InvokePostPipelineStageCallback |
Invokes the PostPipelineStageDelegate for this camera, and up the hierarchy for all
parent cameras (if any).
(Inherited from CinemachineVirtualCameraBase.) | |
IsLiveChild | Check whether the vcam a live child of this camera. (Overrides CinemachineVirtualCameraBaseIsLiveChild(ICinemachineCamera).) | |
MoveToTopOfPrioritySubqueue | When multiple virtual cameras have the highest priority, there is
sometimes the need to push one to the top, making it the current Live camera if
it shares the highest priority in the queue with its peers.
This happens automatically when a
new vcam is enabled: the most recent one goes to the top of the priority subqueue.
Use this method to push a vcam to the top of its priority peers.
If it and its peers share the highest priority, then this vcam will become Live. (Inherited from CinemachineVirtualCameraBase.) | |
OnDestroy | Base class implementation removes the virtual camera from the priority queue. (Inherited from CinemachineVirtualCameraBase.) | |
OnDisable | Base class implementation makes sure the priority queue remains up-to-date. (Inherited from CinemachineVirtualCameraBase.) | |
OnEnable | Makes sure the internal child cache is up to date (Overrides CinemachineVirtualCameraBaseOnEnable.) | |
OnTransformChildrenChanged | Makes sure the internal child cache is up to date | |
OnTransformParentChanged | Base class implementation makes sure the priority queue remains up-to-date. (Inherited from CinemachineVirtualCameraBase.) | |
OnTransitionFromCamera | Notification that this virtual camera is going live.
Base class implementationmust be called by any overridden method. (Inherited from CinemachineVirtualCameraBase.) | |
OnValidate | Makes sure the weights are non-negative (Overrides CinemachineVirtualCameraBaseOnValidate.) | |
PreUpdateChildCameras |
This is called prior to the updating of the vcam's child cameras,
in order to allow the parent to prepare its children.
If the children are updating on FixedUpdate, then this will not necessarily be called
prior to every FixedUpdate, but it might be called on LateUpdate instead.
Base class implementation does nothing.
(Inherited from CinemachineVirtualCameraBase.) | |
RemovePostPipelineStageHook | Remove a Pipeline stage hook callback.
Make sure it is removed from all the children. (Overrides CinemachineVirtualCameraBaseRemovePostPipelineStageHook(CinemachineVirtualCameraBaseOnPostPipelineStageDelegate).) | |
ResolveFollow | Returns this vcam's Follow target, or if that is null, will retrun
the parent vcam's Follow target. (Inherited from CinemachineVirtualCameraBase.) | |
ResolveLookAt | Returns this vcam's LookAt target, or if that is null, will retrun
the parent vcam's LookAt target. (Inherited from CinemachineVirtualCameraBase.) | |
SetWeight(Int32, Single) | Set the weight of the child at an index. | |
SetWeight(CinemachineVirtualCameraBase, Single) | Set the weight of the child CinemachineVirtualCameraBase. | |
Start | Base class implementation does nothing. (Inherited from CinemachineVirtualCameraBase.) | |
Update | Base class implementation makes sure the priority queue remains up-to-date. (Inherited from CinemachineVirtualCameraBase.) | |
UpdateCameraState | Called by CinemachineCore at designated update time
so the vcam can position itself and track its targets. This implementation
computes and caches the weighted blend of the tracked cameras. (Overrides CinemachineVirtualCameraBaseUpdateCameraState(Vector3, Single).) | |
ValidateListOfChildren | Rebuild the cached list of child cameras. |
Fields
Name | Description | |
---|---|---|
CinemachineGUIDebuggerCallback | This is deprecated. It is here to support the soon-to-be-removed
Cinemachine Debugger in the Editor. (Inherited from CinemachineVirtualCameraBase.) | |
m_ExcludedPropertiesInInspector | Inspector control - Use for hiding sections of the Inspector UI. (Inherited from CinemachineVirtualCameraBase.) | |
m_LockStageInInspector | Inspector control - Use for enabling sections of the Inspector UI. (Inherited from CinemachineVirtualCameraBase.) | |
m_Priority | The priority will determine which camera becomes active based on the
state of other cameras and this camera. Higher numbers have greater priority.
(Inherited from CinemachineVirtualCameraBase.) | |
m_Weight0 | Weight of the first tracked camera | |
m_Weight1 | Weight of the second tracked camera | |
m_Weight2 | Weight of the third tracked camera | |
m_Weight3 | Weight of the fourth tracked camera | |
m_Weight4 | Weight of the fifth tracked camera | |
m_Weight5 | Weight of the sixth tracked camera | |
m_Weight6 | Weight of the seventh tracked camera | |
m_Weight7 | Weight of the eighth tracked camera | |
MaxCameras | The maximum number of tracked cameras. If you want to add
more cameras, do it here in the source code, and be sure to add the
extra member variables and to make the appropriate changes in
GetWeight() and SetWeight().
The inspector will figure itself out based on this value. | |
OnPostPipelineStage |
A delegate to hook into the state calculation pipeline.
Implementaion must be sure to call this after each pipeline stage, to allow
other services to hook into the pipeline.
See CinemachineCore.Stage.
(Inherited from CinemachineVirtualCameraBase.) |
See Also