2
我正在使用Unity和Parse.com進行遊戲開發。我試圖找出我保存後立即檢索objectId。我曾經嘗試這樣做:如何在保存後立即檢索objectId
ParseObject myGame = new ParseObject("Games");
myGame["score"] = 223;
myGame["playerName"] = "Michael";
Task saveTask = myGame.SaveAsync().ContinueWith(t => {
ParseObject theObject = t.Result;
string newObjectId = theObject.objectId;
});
我上t.Result一個錯誤說:
Type `System.Threading.Tasks.Task' does not contain a definition for `Result' and no
extension method `Result' of type `System.Threading.Tasks.Task' could be found (are
you missing a using directive or an assembly reference?)
可以這樣以這種方式或其他工作要做。
任何幫助表示讚賞,並在此先感謝:-)
'這是因爲任務沒有結果property' – CodingDefined 2014-12-02 11:49:43
好了,我不能得到正確的ObjectID回來後保存呢?那麼我需要創建一個新的請求? – Mansa 2014-12-02 12:00:03
嘗試使用t.Result刪除行並在下一行使用myGame.objectID – Reniuz 2014-12-02 12:01:45