如何从 Parse 下载文件列表
How to download list of files from Parse
我正在尝试下载已上传到 Parse 核心的文件。 (我正在使用 Parse Unity SDK)
我有一个 Parse table 调用 "DLC" 来存储所有可下载的文件。
但是现在我不知道如何从应用程序本身下载它。
这些是我的代码,我卡住了
void GetParseFiles()
{
ParseQuery<ParseObject> query = ParseObject.GetQuery("DLC");
query.FindAsync().ContinueWith(t =>
{
if (t.IsCompleted)
{
IEnumerable<ParseObject> results = t.Result;
int count = 0;
foreach(ParseObject obj in results)
{
ParseFile parseFile = obj.Get<ParseFile>("LevelFiles");
WWW request = new WWW(parseFile.Url.AbsoluteUri);
// what should I do in order to get the content of the file?
}
Debug.Log(count);
}
else
{
Debug.Log("Failed");
}
});
}
希望有人能告诉我该怎么做?
我想要实现的是我想将一些数据文件(以 .txt 或 .xml 格式)存储到 Parse 服务器,然后其他用户将从那里获取数据文件。
我在这里找到了我的答案..
如果我需要在函数块中放置 yield 语句,我不应该使用 ContinueWith。
我正在尝试下载已上传到 Parse 核心的文件。 (我正在使用 Parse Unity SDK)
我有一个 Parse table 调用 "DLC" 来存储所有可下载的文件。 但是现在我不知道如何从应用程序本身下载它。
这些是我的代码,我卡住了
void GetParseFiles()
{
ParseQuery<ParseObject> query = ParseObject.GetQuery("DLC");
query.FindAsync().ContinueWith(t =>
{
if (t.IsCompleted)
{
IEnumerable<ParseObject> results = t.Result;
int count = 0;
foreach(ParseObject obj in results)
{
ParseFile parseFile = obj.Get<ParseFile>("LevelFiles");
WWW request = new WWW(parseFile.Url.AbsoluteUri);
// what should I do in order to get the content of the file?
}
Debug.Log(count);
}
else
{
Debug.Log("Failed");
}
});
}
希望有人能告诉我该怎么做? 我想要实现的是我想将一些数据文件(以 .txt 或 .xml 格式)存储到 Parse 服务器,然后其他用户将从那里获取数据文件。
我在这里找到了我的答案..
如果我需要在函数块中放置 yield 语句,我不应该使用 ContinueWith。