- Home /
Unity - wait for data to load from database
hi, i have some important data i need to load from database . the problem is that i need to load the scene only after the data is loaded . and i didn't find a solution for that. hope anyone can help .
The Firebase documentation has examples using dictionary objects and transactions, but I haven't succeeding in writing to the database using those methods, and it took me a week to figure out the correct syntax since I'm very new to program$$anonymous$$g.
Answer by Zaeran · Sep 09, 2020 at 03:17 AM
You can probably do it using a Coroutine. Here's some pseudocode:
IEnumerator GetData()
{
WWWForm form = new WWWForm();
//add required form data
WWW request = new WWW(databasePath, form);
yield return request;
//data has now been returned from the database
if(no errors)
{
// Load scene
}
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613011447im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
SQL connection problem 0 Answers
connect sqlite3 into unity 2 Answers
How do I connect to an Oracle Database? 6 Answers
Connection to firebase via smartphone doesn't work 0 Answers
error while connect database 2 Answers