make sure bundle is loaded first
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user