Skip to content

Instantly share code, notes, and snippets.

@Badgerdox
Created November 17, 2019 18:55
Show Gist options
  • Save Badgerdox/e7e6f65413cb27d7d40491c54834df49 to your computer and use it in GitHub Desktop.
Save Badgerdox/e7e6f65413cb27d7d40491c54834df49 to your computer and use it in GitHub Desktop.
public class LoadedAddressableLocations : MonoBehaviour
{
[SerializeField] private string _label;
public IList<IResourceLocation> AssetLocations { get; } = new List<IResourceLocation>();
private void Start()
{
InitAndWaitUntilLoaded(_label);
}
public async Task InitAndWaitUntilLoaded(string label)
{
await AddressableLocationLoader.GetAll(label, AssetLocations);
foreach (var location in AssetLocations)
{
//ASSETS ARE FULLY LOADED
//PERFORM ADDITIONAL OPERATIONS HERE
Debug.Log(location.PrimaryKey);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment