Exemplo n.º 1
0
        private static void Bind(VisualElement element, SerializedObjectUpdateWrapper objWrapper, SerializedProperty parentProperty)
        {
            IBindable field = element as IBindable;

            using (var evt = SerializedObjectBindEvent.GetPooled(objWrapper.obj))
            {
                if (SendBindingEvent(evt, element))
                {
                    return;
                }
            }

            if (field != null)
            {
                if (!string.IsNullOrEmpty(field.bindingPath))
                {
                    var foundProperty = BindPropertyWithParent(field, objWrapper, parentProperty);
                    if (foundProperty != null)
                    {
                        parentProperty = foundProperty;
                    }
                }
            }

            for (int i = 0; i < element.shadow.childCount; ++i)
            {
                Bind(element.shadow[i], objWrapper, parentProperty);
            }
        }