Hide add and remove buttons for ShowInInspector arrays

This commit is contained in:
VladV 2022-05-08 14:50:00 +03:00
parent e6138b340b
commit b286b66551

View File

@ -33,6 +33,10 @@ namespace TriInspector.Elements
drawElementCallback = DrawElementCallback,
};
var canResize = property.TryGetSerializedProperty(out _) || !property.FieldType.IsArray;
_reorderableListGui.displayAdd &= canResize;
_reorderableListGui.displayRemove &= canResize;
if (!_reorderableListGui.displayAdd && !_reorderableListGui.displayRemove)
{
_reorderableListGui.footerHeight = 0f;