読者です 読者をやめる 読者になる 読者になる

Parse.com + Unity "Constructors and field initializers will be executed from the loading thread"

IEnumerator GetUserName(){
        // userIdで名前を引いて
        ParseQuery<ParseObject> query = ParseObject.GetQuery(ParseTableName.NameTable);
        query = query.WhereEqualTo (ParseColumnName.userUniqueId, userId);

        var queryTask = query.FirstAsync();
        while (!queryTask.IsCompleted) yield return null;
        ParseObject obj = queryTask.Result;
        if(queryTask.IsFaulted){
            userName.text = "anonymouse";
        }
        else{
            userName.text = obj.Get<string>("userName");
        }

        yield return null;
    }

コルーチン風に書いて回避できた。参考 https://www.parse.com/questions/unity-error-constructors-and-field-initializers-will-be-executed-from-the-loading-thread-when-loading-a-scene