Merge branch 'new-content-creations' of https://github.com/Menotdan/FlaxEngine into Menotdan-new-content-creations

This commit is contained in:
Wojtek Figat
2024-09-10 20:00:18 +02:00
6 changed files with 334 additions and 24 deletions

View File

@@ -42,6 +42,32 @@ namespace FlaxEditor.Content
/// <inheritdoc />
public override SpriteHandle DefaultThumbnail => SpriteHandle.Invalid;
private string _cachedTypeDescription = null;
/// <inheritdoc />
public override string TypeDescription
{
get
{
if (_cachedTypeDescription != null)
return _cachedTypeDescription;
Prefab prefab = FlaxEngine.Content.LoadAsync<Prefab>(ID);
if (prefab.WaitForLoaded(5000))
{
_cachedTypeDescription = "Prefab";
}
Actor root = prefab.GetDefaultInstance();
if (root is UIControl or UICanvas)
_cachedTypeDescription = "Widget";
else
_cachedTypeDescription = "Prefab";
return _cachedTypeDescription;
}
}
/// <inheritdoc />
public override bool IsOfType(Type type)
{