File state change include external delete detection

Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com>
This commit is contained in:
chcurran
2021-11-22 11:03:37 -08:00
committed by Chris Burel
parent 805bd8ef56
commit d9f849b03e
22 changed files with 218 additions and 362 deletions
@@ -541,48 +541,4 @@ namespace ScriptCanvasEditor
return AZ::EntityId();
}
void AssetTracker::OnAssetReady(const ScriptCanvasMemoryAsset* asset)
{
AZ::Data::AssetId assetId = CheckAssetId(asset->GetId());
auto assetInUseIter = m_assetsInUse.find(assetId);
if (assetInUseIter != m_assetsInUse.end())
{
AssetTrackerNotificationBus::Broadcast(&AssetTrackerNotifications::OnAssetReady, assetInUseIter->second);
}
}
void AssetTracker::OnAssetReloaded(const ScriptCanvasMemoryAsset* asset)
{
AZ::Data::AssetId assetId = CheckAssetId(asset->GetId());
auto assetInUseIter = m_assetsInUse.find(assetId);
if (assetInUseIter != m_assetsInUse.end())
{
AssetTrackerNotificationBus::Broadcast(&AssetTrackerNotifications::OnAssetReloaded, assetInUseIter->second);
}
}
void AssetTracker::OnAssetSaved(const ScriptCanvasMemoryAsset* asset, bool isSuccessful)
{
AZ::Data::AssetId assetId = CheckAssetId(asset->GetId());
auto assetInUseIter = m_assetsInUse.find(assetId);
if (assetInUseIter != m_assetsInUse.end())
{
AssetTrackerNotificationBus::Broadcast(&AssetTrackerNotifications::OnAssetSaved, assetInUseIter->second, isSuccessful);
}
}
void AssetTracker::OnAssetError(const ScriptCanvasMemoryAsset* asset)
{
AZ::Data::AssetId assetId = CheckAssetId(asset->GetId());
auto assetInUseIter = m_assetsInUse.find(assetId);
if (assetInUseIter != m_assetsInUse.end())
{
AssetTrackerNotificationBus::Broadcast(&AssetTrackerNotifications::OnAssetError, assetInUseIter->second);
}
}
}