Remove redundant asset waiting and reloading when saving materials
This commit is contained in:
@@ -459,8 +459,7 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
/// <returns>True if failed, otherwise false.</returns>
|
/// <returns>True if failed, otherwise false.</returns>
|
||||||
protected virtual bool SaveToOriginal()
|
protected virtual bool SaveToOriginal()
|
||||||
{
|
{
|
||||||
// Wait until temporary asset file be fully loaded
|
if (_asset.LastLoadFailed)
|
||||||
if (_asset.WaitForLoaded())
|
|
||||||
{
|
{
|
||||||
Editor.LogError(string.Format("Cannot save asset {0}. Wait for temporary asset loaded failed.", _item.Path));
|
Editor.LogError(string.Format("Cannot save asset {0}. Wait for temporary asset loaded failed.", _item.Path));
|
||||||
return true;
|
return true;
|
||||||
@@ -494,12 +493,6 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reload original asset
|
|
||||||
if (originalAsset)
|
|
||||||
{
|
|
||||||
originalAsset.Reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Refresh thumbnail
|
// Refresh thumbnail
|
||||||
_item.RefreshThumbnail();
|
_item.RefreshThumbnail();
|
||||||
|
|
||||||
|
|||||||
@@ -355,7 +355,6 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
Editor.LogError("Failed to save surface data");
|
Editor.LogError("Failed to save surface data");
|
||||||
}
|
}
|
||||||
_asset.Reload();
|
_asset.Reload();
|
||||||
_asset.WaitForLoaded();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user