- Home /
How do I know when file is done reading ?
Hello,
I have several data files in my game : one language xml file and several game data json files. I have a "Scene0" that is a loading scene, but there are basically no gameobjects that need be loaded (I'm making a UI project, the UI is entirely populated by the data files).
I would like to know when my data is done being read, to be able to get to the next scene without problem while it's being built on the read files' data.
I haven't found yet a way to check "ok, all files read, all data structures populated, go to next scene".
Can someone hint me and gently shove me in the right direction ? :D
Cheers
Answer by Unified2000 · Jun 01, 2018 at 04:27 PM
I'm not 100% sure on this but I think the Unity's file reader won't return until it has finished reading the file. But you can easily test this by loading a large file and timing it.