Created
November 25, 2019 00:59
-
-
Save Badgerdox/1d9a9539fefa30c9893fabefb6198dda to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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