Various improvements

This commit is contained in:
Wojtek Figat
2023-04-29 12:11:17 +02:00
parent 896f75b789
commit 5a2831d0cb
6 changed files with 27 additions and 21 deletions

View File

@@ -206,6 +206,11 @@ namespace FlaxEditor.GUI
/// </summary>
public event Action SelectedItemChanged;
/// <summary>
/// The custom callback for assets validation. Cane be used to implement a rule for assets to pick.
/// </summary>
public Func<ContentItem, bool> CheckValid;
/// <summary>
/// False if changing selected item is disabled.
/// </summary>
@@ -215,6 +220,8 @@ namespace FlaxEditor.GUI
{
if (_fileExtension != null && !item.Path.EndsWith(_fileExtension))
return false;
if (CheckValid != null && !CheckValid(item))
return false;
if (_type == ScriptType.Null)
return true;