using System.Collections.Generic;
using UnityEngine.Timeline;
namespace UnityEngine.Sequences.Timeline
{
internal static partial class TimelineAssetExtensions
{
///
/// Gets a collection of scene paths found in the given timeline.
///
/// The instance of this method applies to.
/// A read only collection of paths, relative to the project folder.
internal static IReadOnlyCollection GetScenes(this TimelineAsset timeline)
{
List paths = new List();
foreach (TrackAsset track in timeline.GetOutputTracks())
{
if (!(track is SceneActivationTrack) || track.muted)
continue;
SceneActivationTrack scene = track as SceneActivationTrack;
string path = scene.scene.path;
if (string.IsNullOrEmpty(path))
continue;
paths.Add(path);
}
return paths;
}
}
}