Improve collection editor.
This commit is contained in:
@@ -18,7 +18,7 @@ namespace FlaxEditor.Content.Settings
|
||||
/// <summary>
|
||||
/// The layers names.
|
||||
/// </summary>
|
||||
[EditorOrder(10), EditorDisplay("Layers", EditorDisplayAttribute.InlineStyle), Collection(ReadOnly = true)]
|
||||
[EditorOrder(10), EditorDisplay("Layers", EditorDisplayAttribute.InlineStyle), Collection(ReadOnly = true, Display = CollectionAttribute.DisplayType.Inline)]
|
||||
public string[] Layers = new string[32];
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -16,7 +16,7 @@ public:
|
||||
/// <summary>
|
||||
/// The list of the string localization tables used by the game.
|
||||
/// </summary>
|
||||
API_FIELD()
|
||||
API_FIELD(Attributes="Collection(Display = CollectionAttribute.DisplayType.Inline)")
|
||||
Array<AssetReference<LocalizedStringTable>> LocalizedStringTables;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -10,6 +10,32 @@ namespace FlaxEngine
|
||||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Class)]
|
||||
public sealed class CollectionAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// The display type for collections.
|
||||
/// </summary>
|
||||
public enum DisplayType
|
||||
{
|
||||
/// <summary>
|
||||
/// Displays the default display type.
|
||||
/// </summary>
|
||||
Default,
|
||||
|
||||
/// <summary>
|
||||
/// Displays a header.
|
||||
/// </summary>
|
||||
Header,
|
||||
|
||||
/// <summary>
|
||||
/// Displays inline.
|
||||
/// </summary>
|
||||
Inline,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the display type.
|
||||
/// </summary>
|
||||
public DisplayType Display;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether this collection is read-only. If <c>true</c>, applications using this collection should not allow to add or remove items.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user