Merge pull request #1232 from Azaezel/alpha41/reloadredux

reload chain execution
This commit is contained in:
Brian Roberts 2024-03-18 12:22:01 -05:00 committed by GitHub
commit 15971185ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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)

View file

@ -237,6 +237,14 @@ void MaterialAsset::onAssetRefresh()
}
load();
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 MaterialAsset::setScriptFile(const char* pScriptFile)