Hi,
I was wondering… I’m writing the umpteenth runtime file importer in my Unity development life. What’s the best/recommended approach nowadays for asynchronous loading and feedback?
Usually I add three UnityEvents: onImportStarted, onImportProgress, onImportCompleted. Then I’m able to hook basically anything into the loading process.
onImportProgress might pass a percentage float, or the absolute current value and the absolute target value (e.g. 5/23 files read; 2.345/45.000 vertices read)
onImportCompleted might pass the GameObject if it was an object that I loaded; or the JSON converted data object
But now about the asynchronous importing… for example for reading a stream line by line
-
Threaded loading? With a Coroutine polling for changes?
-
async and await, Task and Task?
-
Use a Coroutine?
I’m looking forward to your answers.
Wavy