I have a database that I would like to load on before everything else.
Database Init call has an OnComplete callback which will get executed once the database is loaded.
Can I somehow manually stop/freeze the application until I get that OnComplete action fired off?
The easy way would be to do your database stuff in a loading scene. Once it completes, then you load into your main game scene. That way none of the scripts in the game scene need to be written to wait for the database load to complete.
Yeah exactly what I was thinking of. That would easily work with the build but how I tackle this in the play mode. Should I have a scene manager that always loads up the zero scene and switches to the one I’m working on?
Normally if I need to test data with a loading scene I either just switch to the loading scene and hit play or if I’m happy with the loading scene, I just toss in some local test data that can be loaded from any other scene as if I started play mode from the loading scene.
Yeah I just switch to the loading scene first as well. I’ve seen a few threads on the topic of creating your own system to detect you’re starting in the wrong scene, and automatically switch to the first scene.