Last active
November 18, 2019 18:11
-
-
Save Badgerdox/6d95b2c17af8387cc7e9c257bf7dd34a to your computer and use it in GitHub Desktop.
Create asset by name or label
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 static async Task InitAssets<T>(string assetNameOrLabel, List<T> createdAssets) | |
where T : Object | |
{ | |
var locations = await Addressables.LoadResourceLocationsAsync(assetNameOrLabel).Task; | |
foreach (var location in locations) | |
createdAssets.Add(await Addressables.InstantiateAsync(location).Task as T); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment