Add NoUndo attribute for properties without undo usage
This commit is contained in:
@@ -28,6 +28,7 @@ namespace FlaxEditor.Surface
|
||||
typeof(RangeAttribute),
|
||||
typeof(SpaceAttribute),
|
||||
typeof(NoAnimateAttribute),
|
||||
typeof(NoUndoAttribute),
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -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)
|
||||
|
||||
15
Source/Engine/Scripting/Attributes/Editor/NoUndoAttribute.cs
Normal file
15
Source/Engine/Scripting/Attributes/Editor/NoUndoAttribute.cs
Normal 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
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user