当前上下文中不存在名称“Array”

时间:2018-04-16 14:00:38

标签: c# unity3d

嗨,有谁知道为什么我得到这个错误。将我的项目升级到新版本的unity3d

之后的这个节目

错误CS0103:当前上下文中不存在名称“Array”

#if IAP && UNITY_PURCHASING
private void OnItemPurchased(IAPItem item, int index)
{
    // A consumable product has been purchased by this user.
    if (item.productType == PType.Consumable)
    {
        CurrencyController.CreditBalance(item.value);
        Toast.instance.ShowMessage("Your purchase is successful");
        CUtils.SetBuyItem();
        if(Array.IndexOf(Purchaser.instance.iapItems, item) >= 1)
        {
            CUtils.SetRemoveAds(true);
        }
    }
    // Or ... a non-consumable product has been purchased by this user.
    else if (item.productType == PType.NonConsumable)
    {
        // TODO: The non-consumable item has been successfully purchased, grant this item to the player.
    }
    // Or ... a subscription product has been purchased by this user.
    else if (item.productType == PType.Subscription)
    {
        // TODO: The subscription item has been successfully purchased, grant this to the player.
    }
}

ENDIF

1 个答案:

答案 0 :(得分:5)

晚了聚会,但我想添加一个官方答案。

正如评论中建议的多个人一样,您可能缺少const res = await Product.aggregate([ // $match here if needed { $facet: { documents: [ { $lookup: { from: 'Brand', localField: 'a', foreignField: 'b', as: 'brand' } }, { $sort: { c: 1, 'brand.d': -1 } }, { $skip: offset }, { $limit: productsPerPage } ], total: [ { $count: "count" } ] } }, { $unwind: "$total" } ]) 指令。更具体地说,using

希望这可以帮助将来的程序员更快地找到解决方案。