Files
Hasebe/Library/PackageCache/com.unity.cinemachine@1b8d58983403/Runtime/Helpers/CinemachineCameraManagerEvents.cs
T
2026-09-24 20:49:06 +03:00

40 lines
1.4 KiB
C#

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