您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
32 行
1.0 KiB
32 行
1.0 KiB
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.Playables;
|
|
using UnityEngine.Timeline;
|
|
|
|
namespace Cinemachine.Timeline
|
|
{
|
|
[Serializable]
|
|
[TrackClipType(typeof(CinemachineShot))]
|
|
[TrackMediaType(TimelineAsset.MediaType.Script)]
|
|
[TrackBindingType(typeof(CinemachineBrain))]
|
|
[TrackColor(0.53f, 0.0f, 0.08f)]
|
|
public class CinemachineTrack : TrackAsset
|
|
{
|
|
public override Playable CreateTrackMixer(
|
|
PlayableGraph graph, GameObject go, int inputCount)
|
|
{
|
|
// Hack to set the display name of the clip to match the vcam
|
|
foreach (var c in GetClips())
|
|
{
|
|
CinemachineShot shot = (CinemachineShot)c.asset;
|
|
CinemachineVirtualCameraBase vcam = shot.VirtualCamera.Resolve(graph.GetResolver());
|
|
if (vcam != null)
|
|
c.displayName = vcam.Name;
|
|
}
|
|
|
|
var mixer = ScriptPlayable<CinemachineMixer>.Create(graph);
|
|
mixer.SetInputCount(inputCount);
|
|
return mixer;
|
|
}
|
|
}
|
|
}
|