Skip to content

Instantly share code, notes, and snippets.

@Badgerdox
Last active November 20, 2019 06:59
Show Gist options
  • Save Badgerdox/1999f0cecc2fd12986b67cdd1086bd98 to your computer and use it in GitHub Desktop.
Save Badgerdox/1999f0cecc2fd12986b67cdd1086bd98 to your computer and use it in GitHub Desktop.
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.AddressableAssets;
public class LoadAssetsFromRemote : MonoBehaviour
{
[SerializeField] private string _label;
void Start()
{
Get(_label);
}
private async Task Get(string label)
{
var locations = await Addressables.LoadResourceLocationsAsync(label).Task;
foreach (var location in locations)
await Addressables.InstantiateAsync(location).Task;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment