Add ability to unset type reference with null item

This commit is contained in:
Wojtek Figat
2023-06-28 15:12:58 +02:00
parent 864f5f77f5
commit 9536c37623

View File

@@ -27,6 +27,17 @@ namespace FlaxEditor.GUI
/// </summary>
public ScriptType Type => _type;
/// <summary>
/// Initializes a new instance of the <see cref="TypeItemView"/> class.
/// </summary>
public TypeItemView()
{
_type = ScriptType.Null;
Name = "<null>";
TooltipText = "Unset value.";
Tag = _type;
}
/// <summary>
/// Initializes a new instance of the <see cref="TypeItemView"/> class.
/// </summary>
@@ -83,6 +94,7 @@ namespace FlaxEditor.GUI
// TODO: use async thread to search types without UI stall
var allTypes = Editor.Instance.CodeEditing.All.Get();
AddItem(new TypeItemView());
for (int i = 0; i < allTypes.Count; i++)
{
var type = allTypes[i];