【发布时间】:2020-03-24 13:51:17
【问题描述】:
我正在尝试通过关注this link 在 Unity 中获取 Firestore 集合,但它给了我一个错误:
“任务”不包含“文档”的定义,并且没有可访问的扩展方法“文档”接受“任务”类型的第一个参数。
我的代码:
CollectionReference allCitiesQuery = db.Collection("MyList");
Task<QuerySnapshot> allCitiesQuerySnapshot = allCitiesQuery.GetSnapshotAsync();
foreach (DocumentSnapshot documentSnapshot in allCitiesQuerySnapshot.Documents)
{
Dictionary<string, object> city = documentSnapshot.ToDictionary();
foreach (KeyValuePair<string, object> pair in city)
{
Debug.Log(pair.Key + " " + pair.Value);
//Console.WriteLine("{0}: {1}", pair.Key, pair.Value);
}
}
}
我已阅读文档,但很少关注 Unity,因为几天前它刚刚实现。谁能帮帮我好吗?
【问题讨论】:
标签: firebase unity3d google-cloud-firestore