2
我想要在具有其他類的指針的解析中繼承類。子類具有指向其他類的類
這裏是我的類:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Parse;
using System.Threading.Tasks;
[ParseClassName("UserCars")] public class UserCars : ParseObject {
[ParseFieldName("car")]
public Car car
{
get { return GetProperty<Car>("car"); }
set { SetProperty<Car>(value, "car"); }
}
[ParseFieldName("isBumpers")]
public bool isBumpers
{
get { return GetProperty<bool>("isBumpers"); }
set { SetProperty<bool>(value, "isBumpers"); }
}
當我執行下面isBumpers
此查詢返回準確的布爾值,但car
始終爲空:
var query = new ParseQuery<UserCars>();
query.WhereEqualTo("user", ParseUser.CurrentUser);
query.FindAsync().ContinueWith(t =>
{
IEnumerable<UserCars> userCars = t.Result;
foreach (UserCars u in userCars)
{
Debug.Log(u.car);
}
});
我試着用沒有變化添加此:
IEnumerable<UserCars> userCars = t.Result;
foreach (UserCars u in userCars)
{
Task<Car> fCar = u.car.FetchIfNeededAsync();
Debug.Log(u.car);
}
我錯過了什麼?