private void RemoveProperty()
        {
            USUndoManager.RegisterCompleteObjectUndo(PropertyTimeline, "Remove Curve");
            USUndoManager.RegisterCompleteObjectUndo(this, "Remove Curve");
            foreach (var child in Children)
            {
                USUndoManager.RegisterCompleteObjectUndo(child, "Remove Curve");
            }

            var preFix       = PropertyFieldInfo.Name;
            var propertyInfo = PropertyTimeline.GetProperty(preFix, PropertyFieldInfo.Component);

            foreach (var child in Children)
            {
                ((USPropertyMemberHierarchyItem)child).Curve = null;
            }

            propertyInfo.RestoreBaseState();
            PropertyTimeline.RemoveProperty(propertyInfo);
            USUndoManager.DestroyImmediate(propertyInfo);

            IsSelected = false;
            foreach (var child in Children)
            {
                ((USPropertyMemberHierarchyItem)child).IsSelected = false;
            }
        }
Пример #2
0
        private void RemoveProperty(PropertyBox propertyBox)
        {
            Debug.Log("Removing Property " + propertyBox);
            USUndoManager.RegisterCompleteObjectUndo(PropertyTimeline, "Remove Curve");
            USUndoManager.RegisterCompleteObjectUndo(this, "Remove Curve");
            USUndoManager.PropertyChange(CurveEditor, "Add Curve");

            propertyBoxes.Remove(propertyBox);

            var preFix       = propertyBox.PropertyName;
            var propertyInfo = PropertyTimeline.GetProperty(preFix, propertyBox.Component);

            propertyInfo.curves.ForEach(curve => CurveEditor.Curves.Remove(curve));

            propertyInfo.RestoreBaseState();
            PropertyTimeline.RemoveProperty(propertyInfo);
            USUndoManager.DestroyImmediate(propertyInfo);
        }