您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
26 行
827 B
26 行
827 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.Playables;
|
|
using UnityEngine.Timeline;
|
|
|
|
[TrackColor(1,0.4f,0)]
|
|
// Specifies the type of Playable Asset this track manages
|
|
[TrackClipType(typeof(CameraSwitcherAsset))]
|
|
public class CameraTrack : TrackAsset
|
|
{
|
|
|
|
// override the type of mixer playable used by this track
|
|
public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
|
|
{
|
|
foreach (var c in GetClips())
|
|
{
|
|
CameraSwitcherAsset asset = (CameraSwitcherAsset)c.asset;
|
|
GameObject camera = asset.gameobject.Resolve(graph.GetResolver());
|
|
c.displayName = camera == null ? "Null Camera" : camera.name;
|
|
}
|
|
|
|
return base.CreateTrackMixer(graph, go, inputCount);
|
|
}
|
|
|
|
}
|