using UnityEngine; namespace Unity.Cinemachine { /// /// This component will generate mixer-specific events. /// [AddComponentMenu("Cinemachine/Helpers/Cinemachine Camera Manager Events")] [SaveDuringPlay] [HelpURL(Documentation.BaseURL + "manual/CinemachineCameraManagerEvents.html")] public class CinemachineCameraManagerEvents : CinemachineMixerEventsBase { /// /// This is the CinemachineBrain emitting the events. If null and the current /// GameObject has a CinemachineBrain component, that component will be used. /// [Tooltip("This is the CinemachineCameraManager emitting the events. If null and the current " + "GameObject has a CinemachineCameraManager component, that component will be used.")] public CinemachineCameraManagerBase CameraManager; /// /// Get the object being monitored. This is the object that will generate the events. /// /// The ICinemachineMixer object that is the origin of the events. protected override ICinemachineMixer GetMixer() => CameraManager; void OnEnable() { if (CameraManager == null) TryGetComponent(out CameraManager); InstallHandlers(CameraManager); } void OnDisable() { UninstallHandlers(); } } }