Add asset reload option via context menu in Editor
This commit is contained in:
@@ -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>
|
||||
@@ -83,6 +88,18 @@ namespace FlaxEditor.Content
|
||||
}
|
||||
}
|
||||
|
||||
/// <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>
|
||||
/// Determines whether asset is of the specified type (included inheritance checks).
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user