void RecomputeRectUnions()
        {
            m_MustRecomputeUnions = false;
            m_Unions.Clear();
            if (children == null)
            {
                return;
            }

            foreach (var c in children.OfType <TimelineTrackGUI>())
            {
                c.RebuildGUICacheIfNecessary();
                m_Unions.AddRange(TimelineClipUnion.Build(c.clips));
            }
        }
Example #2
0
        void RecomputeRectUnions()
        {
            m_MustRecomputeUnions = false;
            m_Unions.Clear();
            if (children == null)
            {
                return;
            }

            foreach (var c in children)
            {
                var trackGUI = c as TimelineTrackGUI;
                if (trackGUI != null)
                {
                    trackGUI.RebuildGUICacheIfNecessary();
                    m_Unions.AddRange(TimelineClipUnion.Build(trackGUI.clips));
                }
            }
        }
Example #3
0
        public static List <TimelineClipUnion> Build(List <TimelineClipGUI> clips)
        {
            var unions = new List <TimelineClipUnion>();

            if (clips == null)
            {
                return(unions);
            }

            TimelineClipUnion currentUnion = null;

            foreach (var c in clips)
            {
                if (currentUnion == null)
                {
                    currentUnion = new TimelineClipUnion();
                    currentUnion.Add(c);
                    unions.Add(currentUnion);
                }
                else
                {
                    Rect result;
                    if (Intersection(c.boundingRect, currentUnion.m_BoundingRect, out result))
                    {
                        currentUnion.Add(c);
                    }
                    else
                    {
                        currentUnion = new TimelineClipUnion();
                        currentUnion.Add(c);
                        unions.Add(currentUnion);
                    }
                }
            }

            return(unions);
        }