Search Issue Tracker
Won't Fix
Votes
0
Found in [Package]
1.10.0
Issue ID
ADDR-1295
Regression
No
Addressables method LoadAssetsAsync throws exceptions when passing an array of AssetReference from Scriptable Object
How to reproduce:
1. Open the attached project (LoadAssetsAsync.zip)
2. Open the Scene 'SampleScene'
3. In the Project window select 'New Scriptable Object Test' and make sure that it has the field 'GameObjects' set to address1 and address2
4. Enter Play Mode
Expected result: LoadAssetsAsync is called and no exceptions get printed to the Console window
Actual result: 2 exceptions get printed to the Console window
Reproducible with: 0.8.4-preview (2019.4.2f1), 1.1.5 (2018.4.24f1), 1.10.0 (2019.4.2f1, 2020.1.0b13, 2020.2.0a16)
Could not test with package versions: 0.7.5-preview and below ( 'Addressables' does not contain a definition for 'LoadAssetsAsync')
Notes:
error 1:
Exception encountered in operation UnityEngine.ResourceManagement.ResourceManager+CompletedOperation`1[System.Collections.Generic.IList`1[UnityEngine.GameObject]], result='', status='Failed': Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown., Key=UnityEngine.AddressableAssets.AssetReference[], Type=UnityEngine.GameObject
error 2:
Exception encountered in operation UnityEngine.AddressableAssets.Initialization.InitializationOperation, result='', status='Succeeded' - Chain<IList`1>: ChainOperation of Type: System.Collections.Generic.IList`1[UnityEngine.GameObject] failed because dependent operation failed
Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Inspector elements are rendered twice when the script component is added via drag-and-drop while the HideFlags.HideInInspector property is set
- Error "Light baking failed with error code 5 (Convergence data not available while rendering lightmaps)" thrown in Console when generating lighting for specific GameObjects
- Copy and Paste options for an Animation Property value are disabled in the Right click contextual menu
- Asset is not found when searching the Label "NewLabel" in Search Window
- "Compute dispatch: missing texture ID..." and "Compute dispatch: missing UAV ID..." warnings are thrown after changing the platform in High Definition 3D template
Resolution Note:
message for customer:
the current API does not support taking a list of references. So in a way, this is "as designed". That being said, we know it's not ideal, so we have a ticket in our backlog for adding another override of LoadAssetsAsync that will take a list of AssetReferences. Closing out this ticket as there is a workaround (outlined below) and we have plans of eventually extending the API...
workaround:
List<AssetReference> refs = new List<AssetReference>();
List<object> objs = refs.ConvertAll(singleRef => { return (object)singleRef; });
Addressables.LoadAssetsAsync<GameObject>(objs, null, Addressables.MergeMode.Union);