- Home /
Async code is messing me up
Hello again, I fear what I'm trying to do may be impossible. I'm trying to make an app that can run cross platform which means I need a server that the app communicates with. I chose amazon web services s3, largely because it's the first I tried and turned out to be the cheapest. That being said the only way to get a file list off the server is through the command:
Client.ListObjectsAsync(.......
I ran debug.logs through the code and found that everythings linear until it hits this line at which point the debug.log at the end of this immediately fires and so do the subsequent methods on the main thread. Then about 2 seconds later the ListObjectsAsync spins through and loads its list. A list I needed for comparison sake in subsequent methods.
So far I've tried making this async to do the await command, which I learned Unity can't do, I've tried calling this in a coroutine which didn't fix this, I've also tried to set a bool to true in the async and have the code wait until the bool returned true to no avail. I need this async section of code to run its course and then fire the remaining comparisons.
I guess its also worth noting that I tried to move all comparisons inside the async but it stops when I try to start setting a comparisontext variable (I assume because Unity can't intermingle with async).
Does anyone know a way I can make a list of files on Amazon Web Services S3 without Async or hold my coroutine till this fires? At this point any suggestions would be welcomed, going on 3 days now.