c# - PARSE + Unity3d freezing from a query -


public parseobject therow; public void getcharacterdata(){     string username=parseuser.currentuser.username;     var query = parseobject.getquery ("character").whereequalto ("user", username);     query.firstasync().continuewith(t =>{         therow = t.result;             playerprefs.setstring("username",therow.get<string>("user"));             playerprefs.setstring("some",therow.get<string>("somedata")); // no save data ( use playerprefs other thread mainthread )             debug.log(playerprefs.getstring("username"));     }); debug.log("username",therow.get<string>("user")); // null reference } 

why? assigning t.result therow in asynchronous block of code i'm trying access outside block, therow going null...parse methods need time ...

how can rewrite that?

after 1 sleepless night fixed , made api. ps: anyway :)

https://github.com/realstyle12/parse-and-facebook-unity3d


Comments