2022-01-12 10:06:03 +03:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace UnityEditor.Timeline
|
|
|
|
{
|
|
|
|
struct TrackItemsDrawer
|
|
|
|
{
|
2022-01-12 10:39:15 +03:00
|
|
|
List<ILayer> m_Layers;
|
2022-01-12 10:06:03 +03:00
|
|
|
ClipsLayer m_ClipsLayer;
|
|
|
|
|
2022-01-12 10:39:15 +03:00
|
|
|
public List<TimelineClipGUI> clips => m_ClipsLayer.items;
|
2022-01-12 10:06:03 +03:00
|
|
|
|
|
|
|
public TrackItemsDrawer(IRowGUI parent)
|
|
|
|
{
|
|
|
|
m_Layers = null;
|
|
|
|
m_ClipsLayer = null;
|
|
|
|
BuildGUICache(parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
void BuildGUICache(IRowGUI parent)
|
|
|
|
{
|
|
|
|
m_ClipsLayer = new ClipsLayer(Layer.Clips, parent);
|
2022-01-12 10:39:15 +03:00
|
|
|
m_Layers = new List<ILayer>
|
2022-01-12 10:06:03 +03:00
|
|
|
{
|
|
|
|
m_ClipsLayer,
|
|
|
|
new MarkersLayer(Layer.Markers, parent)
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Draw(Rect rect, WindowState state)
|
|
|
|
{
|
|
|
|
foreach (var layer in m_Layers)
|
|
|
|
{
|
|
|
|
layer.Draw(rect, state);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|