summaryrefslogtreecommitdiff
path: root/Library/PackageCache/com.unity.timeline@1.2.13/Editor/treeview/Drawers/TrackItemsDrawer.cs
blob: 677c2fe6d608bb192cecbc5d41e8be91737acbbc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

namespace UnityEditor.Timeline
{
    struct TrackItemsDrawer
    {
        List<ItemsLayer> m_Layers;
        ClipsLayer m_ClipsLayer;

        public IEnumerable<TimelineClipGUI> clips
        {
            get { return m_ClipsLayer.items.Cast<TimelineClipGUI>(); }
        }

        public TrackItemsDrawer(IRowGUI parent)
        {
            m_Layers = null;
            m_ClipsLayer = null;
            BuildGUICache(parent);
        }

        void BuildGUICache(IRowGUI parent)
        {
            m_ClipsLayer = new ClipsLayer(Layer.Clips, parent);
            m_Layers = new List<ItemsLayer>
            {
                m_ClipsLayer,
                new MarkersLayer(Layer.Markers, parent)
            };
        }

        public void Draw(Rect rect, WindowState state)
        {
            foreach (var layer in m_Layers)
            {
                layer.Draw(rect, state);
            }
        }
    }
}