您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
38 行
1.4 KiB
38 行
1.4 KiB
using UnityEngine;
|
|
using UnityEngine.Playables;
|
|
using UnityEngine.Timeline;
|
|
|
|
namespace Cinemachine.Timeline
|
|
{
|
|
internal sealed class CinemachineShotPlayable : PlayableBehaviour
|
|
{
|
|
public CinemachineVirtualCameraBase VirtualCamera;
|
|
}
|
|
|
|
public sealed class CinemachineShot : PlayableAsset, IPropertyPreview
|
|
{
|
|
public ExposedReference<CinemachineVirtualCameraBase> VirtualCamera;
|
|
|
|
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
|
|
{
|
|
var playable = ScriptPlayable<CinemachineShotPlayable>.Create(graph);
|
|
playable.GetBehaviour().VirtualCamera = VirtualCamera.Resolve(graph.GetResolver());
|
|
return playable;
|
|
}
|
|
|
|
// IPropertyPreview implementation
|
|
public void GatherProperties(PlayableDirector director, IPropertyCollector driver)
|
|
{
|
|
driver.AddFromName<Transform>("m_LocalPosition.x");
|
|
driver.AddFromName<Transform>("m_LocalPosition.y");
|
|
driver.AddFromName<Transform>("m_LocalPosition.z");
|
|
driver.AddFromName<Transform>("m_LocalRotation.x");
|
|
driver.AddFromName<Transform>("m_LocalRotation.y");
|
|
driver.AddFromName<Transform>("m_LocalRotation.z");
|
|
|
|
driver.AddFromName<Camera>("field of view");
|
|
driver.AddFromName<Camera>("near clip plane");
|
|
driver.AddFromName<Camera>("far clip plane");
|
|
}
|
|
}
|
|
}
|