Last active
November 18, 2019 02:40
-
-
Save Badgerdox/eea5a8eb29e72428362f64dcdb3ec842 to your computer and use it in GitHub Desktop.
CreatedAssets.cs #1
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 CreatedAssets : MonoBehaviour | |
{ | |
private LoadedAddressableLocations _loadedLocations; | |
[field: SerializeField] private List<GameObject> Assets { get; } = new List<GameObject>(); | |
private void Start() | |
{ | |
CreateAndWaitUntilCompleted(); | |
} | |
private async Task CreateAndWaitUntilCompleted() | |
{ | |
_loadedLocations = GetComponent<LoadedAddressableLocations>(); | |
await Task.Delay(TimeSpan.FromSeconds(1)); | |
await CreateAddressablesLoader.ByLoadedAddress(_loadedLocations.AssetLocations, Assets); | |
foreach (var asset in Assets) | |
{ | |
//ASSET IS CREATED AND IN THE LIST | |
//PERFORM ADDITIONAL ACTIONS HERE | |
Debug.Log(asset.name); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment