Skip to content

Instantly share code, notes, and snippets.

@Badgerdox
Created November 25, 2019 00:59
Show Gist options
  • Save Badgerdox/1d9a9539fefa30c9893fabefb6198dda to your computer and use it in GitHub Desktop.
Save Badgerdox/1d9a9539fefa30c9893fabefb6198dda to your computer and use it in GitHub Desktop.
public class SortedCreatedAssets : MonoBehaviour
{
[SerializeField] private List<string> _labels = new List<string>(){};
void Start()
{
SortWaitToCreate(_labels);
}
private async Task SortWaitToCreate(List<string> labels)
{
var locations = await Addressables.LoadResourceLocationsAsync(labels.ToArray(), Addressables.MergeMode.UseFirst).Task;
foreach (var location in locations)
{
//Debug.Log(location.PrimaryKey);
Addressables.InstantiateAsync(location);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment