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
Inherited Members
Namespace: Unity.Cinemachine
Assembly: solution.dll
Syntax
[DisallowMultipleComponent]
[ExecuteAlways]
[ExcludeFromPreset]
[AddComponentMenu("Cinemachine/Cinemachine Mixing Camera")]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.cinemachine@3.0/manual/CinemachineMixingCamera.html")]
public class CinemachineMixingCamera : CinemachineCameraManagerBase, ICinemachineMixer, 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. |
Weight0 | Weight of the first tracked camera |
Weight1 | Weight of the second tracked camera |
Weight2 | Weight of the third tracked camera |
Weight3 | Weight of the fourth tracked camera |
Weight4 | Weight of the fifth tracked camera |
Weight5 | Weight of the sixth tracked camera |
Weight6 | Weight of the seventh tracked camera |
Weight7 | Weight of the eighth tracked camera |
Properties
Name | Description |
---|---|
Description | Gets a brief debug description of this virtual camera, for use when displaying debug info |
State | The CameraState object holds all of the information necessary to position the Unity camera. It is the output of this class. |
Methods
Name | Description |
---|---|
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. |
GetWeight(int) | Get the weight of the child at an index. |
GetWeight(CinemachineVirtualCameraBase) | Get the weight of the child CinemachineVirtualCameraBase. |
InternalUpdateCameraState(Vector3, float) | Internal use only. Do not call this method. Called by CinemachineCore at designated update time so the vcam can position itself and track its targets. This implementation updates all the children, chooses the best one, and implements any required blending. |
IsLiveChild(ICinemachineCamera, bool) | Check whether the cam is a live child of this camera. |
OnTransitionFromCamera(ICinemachineCamera, Vector3, float) | Notification that this virtual camera is going live. |
Reset() | Reset the component to default values. |
SetWeight(int, float) | Set the weight of the child at an index. |
SetWeight(CinemachineVirtualCameraBase, float) | Set the weight of the child CinemachineVirtualCameraBase. |
UpdateCameraCache() | Rebuild the camera cache if it's been invalidated |