Class CinemachineMixingCamera
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
Implements
Inherited Members
Namespace: Cinemachine
Assembly: solution.dll
Syntax
[DocumentationSorting(DocumentationSortingAttribute.Level.UserRef)]
[DisallowMultipleComponent]
[ExecuteInEditMode]
[ExcludeFromPreset]
[AddComponentMenu("Cinemachine/CinemachineMixingCamera")]
public class CinemachineMixingCamera : CinemachineVirtualCameraBase, ICinemachineCamera
Fields
Name | Description |
---|---|
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. |
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 |
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 |
Follow | Not used |
LookAt | Not used |
State | The blended CameraState |
Methods
Name | Description |
---|---|
ForceCameraPosition(Vector3, Quaternion) | Force the virtual camera to assume a given position and orientation |
GetWeight(CinemachineVirtualCameraBase) | Get the weight of the child CinemachineVirtualCameraBase. |
GetWeight(int) | Get the weight of the child at an index. |
InternalUpdateCameraState(Vector3, float) | Internal use only. Do not call this methid. 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. |
InvalidateListOfChildren() | Invalidate the cached list of child cameras. |
IsLiveChild(ICinemachineCamera, bool) | Check whether the vcam a live child of this camera. |
OnEnable() | Makes sure the internal child cache is up to date |
OnTargetObjectWarped(Transform, Vector3) | This is called to notify the vcam that a target got warped, so that the vcam can update its internal state to make the camera also warp seamlessy. |
OnTransformChildrenChanged() | Makes sure the internal child cache is up to date |
OnTransitionFromCamera(ICinemachineCamera, Vector3, float) | Notification that this virtual camera is going live. |
OnValidate() | Makes sure the weights are non-negative |
SetWeight(CinemachineVirtualCameraBase, float) | Set the weight of the child CinemachineVirtualCameraBase. |
SetWeight(int, float) | Set the weight of the child at an index. |
ValidateListOfChildren() | Rebuild the cached list of child cameras. |