Created
November 17, 2019 18:55
-
-
Save Badgerdox/e7e6f65413cb27d7d40491c54834df49 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 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