コード例 #1
0
 public override void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc)
 {
     base.Init(ve, bag, cc);
     ve.name        = m_Name.GetValueFromBag(bag, cc);
     ve.pickingMode = m_PickingMode.GetValueFromBag(bag, cc);
     ve.focusIndex  = m_FocusIndex.GetValueFromBag(bag, cc);
     ve.tooltip     = m_Tooltip.GetValueFromBag(bag, cc);
 }
コード例 #2
0
            public override void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc)
            {
                base.Init(ve, bag, cc);
                string propPath = m_PropertyPath.GetValueFromBag(bag, cc);

                if (!string.IsNullOrEmpty(propPath))
                {
                    var field = ve as IBindable;
                    if (field != null)
                    {
                        field.bindingPath = propPath;
                    }
                }
            }
コード例 #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];
                }
            }
コード例 #4
0
            public override void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc)
            {
                base.Init(ve, bag, cc);

                TemplateContainer templateContainer = ((TemplateContainer)ve);

                templateContainer.templateId = m_Template.GetValueFromBag(bag);
                VisualTreeAsset vea = cc.visualTreeAsset.ResolveTemplate(templateContainer.templateId);

                if (vea == null)
                {
                    templateContainer.Add(new Label(string.Format("Unknown Element: '{0}'", templateContainer.templateId)));
                }
                else
                {
                    vea.CloneTree(templateContainer, cc.slotInsertionPoints);
                }

                if (vea == null)
                {
                    Debug.LogErrorFormat("Could not resolve template with name '{0}'", templateContainer.templateId);
                }
            }
コード例 #5
0
 public override void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc)
 {
     base.Init(ve, bag, cc);
     ((BaseTextElement)ve).text = m_Text.GetValueFromBag(bag);
 }
コード例 #6
0
 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);
 }