Add NoUndo attribute for properties without undo usage

This commit is contained in:
Wojtek Figat
2021-07-24 23:37:44 +02:00
parent 135c0636bf
commit caaae8af78
3 changed files with 18 additions and 1 deletions

View File

@@ -28,6 +28,7 @@ namespace FlaxEditor.Surface
typeof(RangeAttribute),
typeof(SpaceAttribute),
typeof(NoAnimateAttribute),
typeof(NoUndoAttribute),
};
/// <summary>

View File

@@ -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<MemberInfoPath.Entry> membersPath, List<TypeEntry> result, List<object> values, Stack<object> refStack, ScriptType memberType, object memberValue)

View File

@@ -0,0 +1,15 @@
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
namespace FlaxEngine
{
/// <summary>
/// Makes a property to not use undo/redo when modifying it in Editor.
/// </summary>
[Serializable]
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
public sealed class NoUndoAttribute : Attribute
{
}
}