Skip to content

Instantly share code, notes, and snippets.

@Badgerdox
Created November 18, 2019 04:02
Show Gist options
  • Save Badgerdox/c1cea8269dda49c3e3df86052769380c to your computer and use it in GitHub Desktop.
Save Badgerdox/c1cea8269dda49c3e3df86052769380c to your computer and use it in GitHub Desktop.
CreateAddressablesLoader #2
public static class CreateAddressablesLoader
{
public static async Task ByAddress<T>(string label, List<T> createdAssets) where T : Object
{
var tempLocations = new List<IResourceLocation>();
await AddressableLocationLoader.GetAll(label, tempLocations);
foreach (var location in tempLocations)
{
var obj = await Addressables.InstantiateAsync(location).Task as T;
createdAssets.Add(obj);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment