#if CINEMACHINE_TIMELINE using UnityEngine; using UnityEngine.Playables; using UnityEngine.Timeline; namespace Unity.Cinemachine { /// /// Internal use only. Not part of the public API. /// public sealed class CinemachineShot : PlayableAsset, IPropertyPreview { /// The name to display on the track. If empty, the CmCamera's name will be used. [Tooltip("The name to display on the track. If empty, the CmCamera's name will be used.")] public string DisplayName; /// The Cinemachine camera to use for this shot [Tooltip("The Cinemachine camera to use for this shot")] public ExposedReference VirtualCamera; /// PlayableAsset implementation /// /// /// public override Playable CreatePlayable(PlayableGraph graph, GameObject owner) { var playable = ScriptPlayable.Create(graph); playable.GetBehaviour().VirtualCamera = VirtualCamera.Resolve(graph.GetResolver()); return playable; } /// IPropertyPreview implementation /// /// public void GatherProperties(PlayableDirector director, IPropertyCollector driver) { driver.AddFromName("m_LocalPosition.x"); driver.AddFromName("m_LocalPosition.y"); driver.AddFromName("m_LocalPosition.z"); driver.AddFromName("m_LocalRotation.x"); driver.AddFromName("m_LocalRotation.y"); driver.AddFromName("m_LocalRotation.z"); driver.AddFromName("m_LocalRotation.w"); driver.AddFromName("field of view"); driver.AddFromName("near clip plane"); driver.AddFromName("far clip plane"); } } } #endif