Пример #1
0
        void DoTrackBindingGUI(Rect rect, Rect headerRect)
        {
            var bindingRect = new Rect(
                rect.xMin,
                rect.y + (rect.height - WindowConstants.trackHeaderButtonSize) / 2f,
                headerRect.xMax - WindowConstants.trackHeaderMaxButtonsWidth - rect.xMin,
                WindowConstants.trackHeaderButtonSize);

            if (bindingRect.Contains(Event.current.mousePosition) && TimelineDragging.IsDraggingEvent() && DragAndDrop.objectReferences.Length == 1)
            {
                TimelineDragging.HandleBindingDragAndDrop(track, BindingUtility.GetRequiredBindingType(m_TrackDrawData.m_Binding));
                Event.current.Use();
            }
            else
            {
                if (m_TrackDrawData.m_Binding.outputTargetType != null && typeof(Object).IsAssignableFrom(m_TrackDrawData.m_Binding.outputTargetType))
                {
                    ObjectBindingField(bindingRect, m_TrackDrawData.m_TrackBinding, m_TrackDrawData.m_Binding);
                }
            }
        }
        void DoTrackBindingGUI(Rect rect, Rect headerRect, WindowState state)
        {
            var spaceUsedByButtons = 2f + ((5 + WindowConstants.trackHeaderButtonPadding) * WindowConstants.trackHeaderButtonSize);

            rect.y     += (rect.height - 16.0f) / 2f;
            rect.height = 16f;
            rect.width  = (headerRect.xMax - spaceUsedByButtons - rect.xMin);

            var binding = state.editSequence.director.GetGenericBinding(track);

            if (rect.Contains(Event.current.mousePosition) && TimelineDragging.IsDraggingEvent() && DragAndDrop.objectReferences.Length == 1)
            {
                TimelineDragging.HandleBindingDragAndDrop(track, BindingUtility.GetRequiredBindingType(m_Bindings[0]));
            }
            else
            {
                if (m_Bindings[0].outputTargetType != null && typeof(Object).IsAssignableFrom(m_Bindings[0].outputTargetType))
                {
                    ObjectBindingField(rect, binding, m_Bindings[0]);
                }
            }
        }