make sure bundle is loaded first

This commit is contained in:
Le Duc Anh
2026-02-19 19:10:31 +07:00
parent 2d08405d56
commit 36448c7d08
@@ -128,14 +128,15 @@ namespace BrewMonster.Scripts
if (_loadedPrefabAssets.ContainsKey(assetPath))
{
BMLogger.Log($"AddressableManager: Asset already loaded: {assetPath} is valid: (${_loadedPrefabAssets[assetPath].Result != null})");
return _loadedPrefabAssets[assetPath].Result;
}
try
{
var handle = Addressables.LoadAssetAsync<GameObject>(assetPath);
_loadedPrefabAssets[assetPath] = handle;
await handle.Task;
_loadedPrefabAssets[assetPath] = handle;
return handle.Result;
}
catch (System.Exception e)