public static async Task <Sprite> GetSpriteFromAtlasAsync(string name) { FirebaseManager.CheckWaitForReady((object sender, bool success) => { if (success) { FirebaseManager.LogCrashlytics($"{Const.CRASHLYTIC_LOG_PICTURE}_{name}"); } }); //check if atlas exist string atlasAddress = GetAtlasAddressFromPictureName(name); AsyncOperationHandle <IList <IResourceLocation> > handle = Addressables.LoadResourceLocationsAsync(atlasAddress); await handle.Task; bool atlasExist = handle.Result.Count > 0; //.Log($"Atlas Exist: {atlasExist}"); Addressables.Release(handle); //if not, use OTHER atlas if (!atlasExist) { atlasAddress = GetAtlasAddressFromPictureName("OTHER"); } //return sprite from atlas var cachedAddressable = await AddressablePreloader.Load <SpriteAtlas>(atlasAddress); SpriteAtlas atlas = cachedAddressable.Result as SpriteAtlas; if (atlas != null) { Sprite spr = atlas.GetSprite(name); if (spr == null) { Debug.LogError($"Sprite [{name}] not found in atlas {atlasAddress}"); } return(spr); } else { Debug.LogError($"Atlas addressable [{name}] not found {atlasAddress}"); return(null); } /*var asyncOperationHandle = Addressables.LoadAssetAsync<SpriteAtlas>(atlasAddress); * await asyncOperationHandle.Task; * if (asyncOperationHandle.Result != null) * return asyncOperationHandle.Result.GetSprite(name); * else return null;*/ }