public override void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc)
            {
                base.Init(ve, bag, cc);

                TextField field = ((TextField)ve);

                field.multiline = m_Multiline.GetValueFromBag(bag, cc);
                field.SetValueWithoutNotify(field.text);
            }
            public override void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc)
            {
                base.Init(ve, bag, cc);

                ScrollView scrollView = (ScrollView)ve;

                scrollView.showHorizontal      = m_ShowHorizontal.GetValueFromBag(bag, cc);
                scrollView.showVertical        = m_ShowVertical.GetValueFromBag(bag, cc);
                scrollView.stretchContentWidth = m_StretchContentWidth.GetValueFromBag(bag, cc);
                scrollView.horizontalPageSize  = m_HorizontalPageSize.GetValueFromBag(bag, cc);
                scrollView.verticalPageSize    = m_VerticalPageSize.GetValueFromBag(bag, cc);
            }
Beispiel #3
0
            public override void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc)
            {
                base.Init(ve, bag, cc);

                TextInputFieldBase <T> field = ((TextInputFieldBase <T>)ve);

                field.maxLength       = m_MaxLength.GetValueFromBag(bag);
                field.isPasswordField = m_Password.GetValueFromBag(bag);
                string maskCharacter = m_MaskCharacter.GetValueFromBag(bag);

                if (maskCharacter != null && maskCharacter.Length > 0)
                {
                    field.maskChar = maskCharacter[0];
                }
            }
Beispiel #4
0
            public override void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc)
            {
                base.Init(ve, bag, cc);

                Vector2 horizontalScrollerValues = new Vector2(m_HorizontalLowValue.GetValueFromBag(bag), m_HorizontalHighValue.GetValueFromBag(bag));
                Vector2 verticalScrollerValues   = new Vector2(m_VerticalLowValue.GetValueFromBag(bag), m_VerticalHighValue.GetValueFromBag(bag));

                ScrollView scrollView = (ScrollView)ve;

                scrollView.horizontalScrollerValues           = horizontalScrollerValues;
                scrollView.verticalScrollerValues             = verticalScrollerValues;
                scrollView.showHorizontal                     = m_ShowHorizontal.GetValueFromBag(bag);
                scrollView.showVertical                       = m_ShowVertical.GetValueFromBag(bag);
                scrollView.scrollOffset                       = new Vector2(m_HorizontalValue.GetValueFromBag(bag), m_VerticalValue.GetValueFromBag(bag));
                scrollView.horizontalScroller.slider.pageSize = m_HorizontalPageSize.GetValueFromBag(bag);
                scrollView.verticalScroller.slider.pageSize   = m_VerticalPageSize.GetValueFromBag(bag);
            }
 public override void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc)
 {
     base.Init(ve, bag, cc);
     ((Toggle)ve).m_Label.text = m_Label.GetValueFromBag(bag);
     ((Toggle)ve).value        = m_Value.GetValueFromBag(bag);
 }