gpt4 book ai didi

c# - 名称 `Array'在当前上下文中不存在

转载 作者:行者123 更新时间:2023-12-03 16:18:04 28 4
gpt4 key购买 nike

有人知道为什么我会收到此错误吗?这显示将我的项目升级到新版本的Unity3d之后。

Error CS0103: The name `Array' does not exist in the current context

#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

最佳答案

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

正如评论中的多个建议所建议,您可能缺少using指令。更具体地说using System;

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

关于c# - 名称 `Array'在当前上下文中不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49859165/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com