reload chain execution

for imageassets and materialassets, check any other assets using them, and uppon completion of reloading, kick off the using assets reload as well in serial
This commit is contained in:
AzaezelX 2024-03-17 21:30:19 -05:00
parent 9f5c74c79a
commit bfc921da22
2 changed files with 17 additions and 0 deletions

View file

@ -301,6 +301,15 @@ void ImageAsset::initializeAsset()
void ImageAsset::onAssetRefresh()
{
mImagePath = getOwned() ? expandAssetFilePath(mImageFileName) : mImagePath;
AssetManager::typeAssetDependsOnHash::Iterator assetDependenciesItr = mpOwningAssetManager->getDependedOnAssets()->find(mpAssetDefinition->mAssetId);
// Iterate all dependencies.
while (assetDependenciesItr != mpOwningAssetManager->getDependedOnAssets()->end() && assetDependenciesItr->key == mpAssetDefinition->mAssetId)
{
StringTableEntry assetId = assetDependenciesItr->value;
AssetBase* dependent = AssetDatabase.acquireAsset<AssetBase>(assetId);
dependent->refreshAsset();
}
}
void ImageAsset::_onResourceChanged(const Torque::Path& path)