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

# Conflicts:
#	Flax.flaxproj
#	Source/Editor/Content/Items/AssetItem.cs
This commit is contained in:
Wojtek Figat
2023-06-13 15:41:07 +02:00
19 changed files with 175 additions and 98 deletions

View File

@@ -23,6 +23,11 @@ namespace FlaxEditor.Content
/// </summary>
public string TypeName { get; }
/// <summary>
/// Returns true if asset is now loaded.
/// </summary>
public bool IsLoaded => FlaxEngine.Content.GetAsset(ID)?.IsLoaded ?? false;
/// <summary>
/// Initializes a new instance of the <see cref="AssetItem"/> class.
/// </summary>
@@ -89,7 +94,19 @@ namespace FlaxEditor.Content
/// <returns>The asset object.</returns>
public Asset LoadAsync()
{
return FlaxEngine.Content.LoadAsync<BinaryAsset>(ID);
return FlaxEngine.Content.LoadAsync<Asset>(ID);
}
/// <summary>
/// Reloads the asset (if it's loaded).
/// </summary>
public void Reload()
{
var asset = FlaxEngine.Content.GetAsset(ID);
if (asset != null && asset.IsLoaded)
{
asset.Reload();
}
}
/// <summary>