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"); } }
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); }
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); }