diff --git a/Source/Editor/Surface/NodeFactory.cs b/Source/Editor/Surface/NodeFactory.cs index 52441ca01..2888010f9 100644 --- a/Source/Editor/Surface/NodeFactory.cs +++ b/Source/Editor/Surface/NodeFactory.cs @@ -28,6 +28,7 @@ namespace FlaxEditor.Surface typeof(RangeAttribute), typeof(SpaceAttribute), typeof(NoAnimateAttribute), + typeof(NoUndoAttribute), }; /// diff --git a/Source/Editor/Utilities/ObjectSnapshot.cs b/Source/Editor/Utilities/ObjectSnapshot.cs index 8f29d1145..9a5eff815 100644 --- a/Source/Editor/Utilities/ObjectSnapshot.cs +++ b/Source/Editor/Utilities/ObjectSnapshot.cs @@ -48,7 +48,8 @@ namespace FlaxEditor.Utilities private static readonly Type[] AttributesIgnoreList = { typeof(NonSerializedAttribute), - typeof(NoSerializeAttribute) + typeof(NoSerializeAttribute), + typeof(NoUndoAttribute), }; private static void GetEntries(MemberInfoPath.Entry member, Stack membersPath, List result, List values, Stack refStack, ScriptType memberType, object memberValue) diff --git a/Source/Engine/Scripting/Attributes/Editor/NoUndoAttribute.cs b/Source/Engine/Scripting/Attributes/Editor/NoUndoAttribute.cs new file mode 100644 index 000000000..0ff6d127f --- /dev/null +++ b/Source/Engine/Scripting/Attributes/Editor/NoUndoAttribute.cs @@ -0,0 +1,15 @@ +// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved. + +using System; + +namespace FlaxEngine +{ + /// + /// Makes a property to not use undo/redo when modifying it in Editor. + /// + [Serializable] + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + public sealed class NoUndoAttribute : Attribute + { + } +}