public override void Setup(VariableSet target, SerializedProperty property, FieldInfo fieldInfo, PropertyAttribute attribute)
        {
            _property  = property;
            _variables = target;
            _proxy     = new VariablesProxy {
                List = target
            };

            if (property.serializedObject.targetObject is ISchemaOwner owner)
            {
                owner.SetupSchema();
            }

            if (_variables.Owner != null && _variables.NeedsUpdate)
            {
                _variables.Update();
                EditorUtility.SetDirty(property.serializedObject.targetObject);
            }

            _list.Setup(_proxy)
            .MakeDrawable(DrawVariable)
            .MakeCustomHeight(GetVariableHeight)
            .MakeCollapsable(property.isExpanded, OnCollapse)
            .MakeEmptyLabel(_emptyLabel);
        }
Esempio n. 2
0
        public override void Setup(VariableList target, SerializedProperty property, FieldInfo fieldInfo, PropertyAttribute attribute)
        {
            _variables = target;
            _proxy     = new VariablesProxy {
                List = target
            };

            if (_variables.Owner != null && _variables.NeedsUpdate)
            {
                _variables.Update();
                EditorUtility.SetDirty(property.serializedObject.targetObject);
            }

            _list.Setup(_proxy)
            .MakeDrawable(DrawVariable)
            .MakeCollapsable(property.serializedObject.targetObject.GetType().Name + "." + property.propertyPath + ".IsOpen")
            .MakeEmptyLabel(_emptyLabel);
        }