Esempio n. 1
0
        void SetupLabel()
        {
            if (typeof(IValueField <U>).IsAssignableFrom(typeof(T)))
            {
                m_Label.styleSheets.Add(Resources.Load <StyleSheet>("VFXLabeledField"));
                if (typeof(U) == typeof(float))
                {
                    var dragger = new VFXFieldMouseDragger <float>((IValueField <float>)m_Control, DragValueFinished);
                    dragger.SetDragZone(m_Label);
                    m_Label.AddToClassList("cursor-slide-arrow");
                }
                else if (typeof(U) == typeof(double))
                {
                    var dragger = new VFXFieldMouseDragger <double>((IValueField <double>)m_Control, DragValueFinished);
                    dragger.SetDragZone(m_Label);
                    m_Label.AddToClassList("cursor-slide-arrow");
                }
                else if (typeof(U) == typeof(long))
                {
                    var dragger = new VFXFieldMouseDragger <long>((IValueField <long>)m_Control, DragValueFinished);
                    dragger.SetDragZone(m_Label);
                    m_Label.AddToClassList("cursor-slide-arrow");
                }
                else if (typeof(U) == typeof(int))
                {
                    var dragger = new VFXFieldMouseDragger <int>((IValueField <int>)m_Control, DragValueFinished);
                    dragger.SetDragZone(m_Label);
                    m_Label.AddToClassList("cursor-slide-arrow");
                }
            }

            m_IndeterminateLabel = new Label()
            {
                name = "indeterminate",
                text = VFXControlConstants.indeterminateText
            };
            m_IndeterminateLabel.SetEnabled(false);
        }
Esempio n. 2
0
        void SetupLabel()
        {
            if (typeof(IValueField <U>).IsAssignableFrom(typeof(T)))
            {
                if (typeof(U) == typeof(float))
                {
                    var dragger = new VFXFieldMouseDragger <float>((IValueField <float>)m_Control, DragValueFinished);
                    dragger.SetDragZone(m_Label);
                    m_Label.style.cursor = UIElementsEditorUtility.CreateDefaultCursorStyle(MouseCursor.SlideArrow);
                }
                else if (typeof(U) == typeof(double))
                {
                    var dragger = new VFXFieldMouseDragger <double>((IValueField <double>)m_Control, DragValueFinished);
                    dragger.SetDragZone(m_Label);
                    m_Label.style.cursor = UIElementsEditorUtility.CreateDefaultCursorStyle(MouseCursor.SlideArrow);
                }
                else if (typeof(U) == typeof(long))
                {
                    var dragger = new VFXFieldMouseDragger <long>((IValueField <long>)m_Control, DragValueFinished);
                    dragger.SetDragZone(m_Label);
                    m_Label.style.cursor = UIElementsEditorUtility.CreateDefaultCursorStyle(MouseCursor.SlideArrow);
                }
                else if (typeof(U) == typeof(int))
                {
                    var dragger = new VFXFieldMouseDragger <int>((IValueField <int>)m_Control, DragValueFinished);
                    dragger.SetDragZone(m_Label);
                    m_Label.style.cursor = UIElementsEditorUtility.CreateDefaultCursorStyle(MouseCursor.SlideArrow);
                }
            }

            m_IndeterminateLabel = new Label()
            {
                name = "indeterminate",
                text = VFXControlConstants.indeterminateText
            };
            m_IndeterminateLabel.SetEnabled(false);
        }