protected override INotifyValueChanged<float> CreateSimpleField(out TextValueField<float> textField)
 {
     var field = new VFXLabeledField<FloatField, float>(m_Label);
     field.onValueDragFinished = t => DelayedNotifyValueChange();
     textField = field.control;
     return field;
 }
示例#2
0
        protected override INotifyValueChanged <float> CreateSliderField(out VFXBaseSliderField <float> slider)
        {
            var field = new VFXLabeledField <VFXFloatSliderField, float>(m_Label);

            slider = field.control;
            return(field);
        }
        public Vector3PropertyRM(IPropertyRMProvider controller, float labelWidth) : base(controller, labelWidth)
        {
            bool isColor = VFXPropertyAttribute.IsColor(m_Provider.attributes);

            if (isColor)
            {
                m_ColorField = new VFXColorField(m_Label);
                m_ColorField.OnValueChanged = OnColorValueChanged;
                m_ColorField.showAlpha      = false;
                m_VectorField = new VFXVector3Field();
                m_VectorField.RegisterCallback <ChangeEvent <Vector3> >(OnValueChanged);
                var mainContainer = new VisualElement()
                {
                    name = "mainContainer"
                };
                mainContainer.AddToClassList("maincontainer");

                mainContainer.Add(m_ColorField);
                mainContainer.Add(m_VectorField);
                Add(mainContainer);
                m_VectorField.AddToClassList("fieldContainer");
            }
            else
            {
                var labeledField = new VFXLabeledField <VFXVector3Field, Vector3>(m_Label);
                m_VectorField = labeledField.control;
                labeledField.RegisterCallback <ChangeEvent <Vector3> >(OnValueChanged);
                Add(labeledField);
                labeledField.AddToClassList("fieldContainer");
            }
        }
示例#4
0
        protected override INotifyValueChanged <int> CreateSimpleField(out TextValueField <int> textField)
        {
            var field = new VFXLabeledField <IntegerField, int>(m_Label);

            textField = field.control;
            field.onValueDragFinished = t => DelayedNotifyValueChange();
            return(field);
        }
示例#5
0
        public Vector3SpaceablePropertyRM(IPropertyRMProvider controller, float labelWidth) : base(controller, labelWidth)
        {
            m_VectorField = new VFXLabeledField <VFXVector3Field, Vector3>(m_Label);
            m_VectorField.RegisterCallback <ChangeEvent <Vector3> >(OnValueChanged);
            m_VectorField.AddToClassList("fieldContainer");

            Add(m_VectorField);
        }
示例#6
0
        protected INotifyValueChanged <Vector2> CreateSimpleField(out VFXVector2Field textField)
        {
            var field = new VFXLabeledField <VFXVector2Field, Vector2>(m_Label);

            field.onValueDragFinished = t => ValueDragFinished();
            field.onValueDragStarted  = t => ValueDragStarted();
            textField = field.control;
            return(field);
        }
示例#7
0
        protected INotifyValueChanged <Vector2> CreateSliderField(out VFXMinMaxSliderField slider)
        {
            var field = new VFXLabeledField <VFXMinMaxSliderField, Vector2>(m_Label);

            slider = field.control;
            slider.onValueDragFinished = ValueDragFinished;
            slider.onValueDragStarted  = ValueDragStarted;
            slider.RegisterCallback <BlurEvent>(OnFocusLost);
            return(field);
        }
示例#8
0
        void CreateTextField()
        {
            m_X = new VFXLabeledField <IntegerField, int>("X");
            m_Y = new VFXLabeledField <IntegerField, int>("Y");

            m_X.control.AddToClassList("fieldContainer");
            m_Y.control.AddToClassList("fieldContainer");
            m_X.AddToClassList("fieldContainer");
            m_Y.AddToClassList("fieldContainer");

            m_X.RegisterCallback <ChangeEvent <int> >(OnXValueChanged);
            m_Y.RegisterCallback <ChangeEvent <int> >(OnYValueChanged);
        }
示例#9
0
        protected override INotifyValueChanged <long> CreateSimpleField(out TextValueField <long> textField)
        {
            if (VFXPropertyAttribute.IsBitField(m_Provider.attributes))
            {
                var bitfield = new VFXLabeledField <VFX32BitField, long>(m_Label);
                textField = null;
                return(bitfield);
            }
            var field = new VFXLabeledField <LongField, long>(m_Label);

            field.onValueDragFinished = t => DelayedNotifyValueChange();
            textField = field.control;
            return(field);
        }
示例#10
0
        public override INotifyValueChanged <U> CreateField()
        {
            var field = new VFXLabeledField <T, U>(m_Label);

            return(field);
        }
示例#11
0
 protected override INotifyValueChanged<int> CreateSliderField(out VFXBaseSliderField<int> slider)
 {
     var field = new VFXLabeledField<VFXIntSliderField, int>(m_Label);
     slider = field.control;
     return field;
 }