Merge remote-tracking branch 'origin/master' into 1.9

# Conflicts:
#	Source/Editor/Modules/ContentDatabaseModule.cs
#	Source/Editor/Surface/SurfaceUtils.cs
#	Source/Editor/Windows/Assets/MaterialInstanceWindow.cs
#	Source/Engine/Foliage/Foliage.cpp
#	Source/Engine/Graphics/Models/MeshBase.h
#	Source/Engine/Tools/MaterialGenerator/MaterialGenerator.Textures.cpp
This commit is contained in:
Wojtek Figat
2024-09-12 13:38:20 +02:00
111 changed files with 1717 additions and 511 deletions

View File

@@ -5,7 +5,7 @@ using FlaxEngine;
namespace FlaxEditor.Content
{
/// <summary>
/// Content item that contains C# script file with source code.
/// Content item that contains C# file with source code.
/// </summary>
/// <seealso cref="FlaxEditor.Content.ScriptItem" />
public class CSharpScriptItem : ScriptItem

View File

@@ -11,6 +11,8 @@ namespace FlaxEditor.Content
/// <seealso cref="FlaxEditor.Content.JsonAssetItem" />
public sealed class PrefabItem : JsonAssetItem
{
private string _cachedTypeDescription = null;
/// <summary>
/// Initializes a new instance of the <see cref="PrefabItem"/> class.
/// </summary>
@@ -42,6 +44,26 @@ namespace FlaxEditor.Content
/// <inheritdoc />
public override SpriteHandle DefaultThumbnail => SpriteHandle.Invalid;
/// <inheritdoc />
public override string TypeDescription
{
get
{
if (_cachedTypeDescription == null)
{
_cachedTypeDescription = "Prefab";
var prefab = FlaxEngine.Content.Load<Prefab>(ID);
if (prefab)
{
Actor root = prefab.GetDefaultInstance();
if (root is UIControl or UICanvas)
_cachedTypeDescription = "Widget";
}
}
return _cachedTypeDescription;
}
}
/// <inheritdoc />
public override bool IsOfType(Type type)
{