Fix UI with list of null items when layout gets rebuilt at item level

This commit is contained in:
Wojtek Figat
2021-08-12 11:47:38 +02:00
parent 916c2733f0
commit 3cf3f58db1
6 changed files with 60 additions and 19 deletions

View File

@@ -30,6 +30,11 @@ namespace FlaxEditor.CustomEditors
/// </summary>
public readonly List<LayoutElement> Children = new List<LayoutElement>();
/// <summary>
/// The child custom editors.
/// </summary>
public readonly List<CustomEditor> Editors = new List<CustomEditor>();
/// <summary>
/// Gets the control represented by this element.
/// </summary>
@@ -722,6 +727,7 @@ namespace FlaxEditor.CustomEditors
var customEditor = CustomEditor.CurrentCustomEditor;
Assert.IsNotNull(customEditor);
customEditor.OnChildCreated(editor);
Editors.Add(editor);
}
/// <summary>
@@ -730,6 +736,7 @@ namespace FlaxEditor.CustomEditors
public virtual void ClearLayout()
{
Children.Clear();
Editors.Clear();
}
/// <inheritdoc />