diff --git a/Source/Editor/CustomEditors/Editors/CollectionEditor.cs b/Source/Editor/CustomEditors/Editors/CollectionEditor.cs index 28a15cd47..a170ec3e0 100644 --- a/Source/Editor/CustomEditors/Editors/CollectionEditor.cs +++ b/Source/Editor/CustomEditors/Editors/CollectionEditor.cs @@ -184,7 +184,7 @@ namespace FlaxEditor.CustomEditors.Editors var overrideEditor = overrideEditorType != null ? (CustomEditor)Activator.CreateInstance(overrideEditorType) : null; var property = panel.AddPropertyItem(new CollectionItemLabel(this, i)); var itemLayout = useSharedLayout ? (LayoutElementsContainer)property : property.VerticalPanel(); - itemLayout.Object(new ListValueContainer(elementType, i, Values), overrideEditor); + itemLayout.Object(new ListValueContainer(elementType, i, Values, attributes), overrideEditor); } } else @@ -202,7 +202,7 @@ namespace FlaxEditor.CustomEditors.Editors var overrideEditor = overrideEditorType != null ? (CustomEditor)Activator.CreateInstance(overrideEditorType) : null; var property = panel.AddPropertyItem("Element " + i); var itemLayout = useSharedLayout ? (LayoutElementsContainer)property : property.VerticalPanel(); - itemLayout.Object(new ListValueContainer(elementType, i, Values), overrideEditor); + itemLayout.Object(new ListValueContainer(elementType, i, Values, attributes), overrideEditor); } } } diff --git a/Source/Editor/CustomEditors/Values/ListValueContainer.cs b/Source/Editor/CustomEditors/Values/ListValueContainer.cs index b6596c329..1edc50709 100644 --- a/Source/Editor/CustomEditors/Values/ListValueContainer.cs +++ b/Source/Editor/CustomEditors/Values/ListValueContainer.cs @@ -12,6 +12,8 @@ namespace FlaxEditor.CustomEditors /// public class ListValueContainer : ValueContainer { + private readonly object[] _attributes; + /// /// The index in the collection. /// @@ -34,9 +36,12 @@ namespace FlaxEditor.CustomEditors /// Type of the collection elements. /// The index. /// The collection values. - public ListValueContainer(ScriptType elementType, int index, ValueContainer values) + /// The collection property attributes to inherit. + public ListValueContainer(ScriptType elementType, int index, ValueContainer values, object[] attributes = null) : this(elementType, index) { + _attributes = attributes; + Capacity = values.Count; for (int i = 0; i < values.Count; i++) { @@ -120,5 +125,11 @@ namespace FlaxEditor.CustomEditors _hasReferenceValue = true; } } + + /// + public override object[] GetAttributes() + { + return _attributes ?? base.GetAttributes(); + } } }