Unity IAP:如何编写脚本为Unity的当前版本提供无代码IAP的功能?

时间:2019-05-19 11:38:02

标签: c# unity3d in-app-purchase

我想实施无代码IAP,使人们可以在Mac App Store中购买非消耗性的Unity应用。

我正在使用 2017.4.27f 。无代码IAP的文档指出,不需要太多脚本。这是我第一次在应用程序中实现IAP。我不知道完成交易所需的所有功能。

Unity提供的Unity IAP示例最后一次于2016年1月使用Unity 5.3更新。

https://bitbucket.org/Unity-Technologies/unity-iap-samples/src/master/

在我导入资产后,它们会产生以下脚本错误。

Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(20,19): error CS0234: The type or namespace name `Store' does not exist in the namespace `UnityEngine'. Are you missing an assembly reference?

Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(630,38): error CS0246: The type or namespace name `ILoginListener' could not be found. Are you missing an assembly reference?

Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(634,25): error CS0246: The type or namespace name `UserInfo' could not be found. Are you missing an assembly reference?

Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(647,29): error CS0246: The type or namespace name `UserInfo' could not be found. Are you missing an assembly reference?

这是Unity提供的产生错误的脚本。

https://bitbucket.org/Unity-Technologies/unity-iap-samples/src/master/UnityIAPDemo/Assets/Scripts/UnityIAPDemo.cs

如果这些错误已得到纠正,该脚本可以与Unity for IAP的当前版本一起使用吗?

我已经搜索了几天,以获取有关Unity IAP的最新信息。我只找到了向人们展示如何创建Unity IAP按钮以及如何使用Debug.log语句创建过程的视频,用于完成购买和失败的购买。他们都没有提供示例脚本,我可以以此为起点来学习这些东西。

所引用的Unity教程也很旧。我遇到同样的错误。

https://unity3d.com/learn/tutorials/topics/ads-analytics/integrating-unity-iap-your-game

在这里或在Game Development Stack Exchange中,我没有发现任何涉及基本Unity IAP信息的问题。

我无法从Unity找到最新的教程。

阅读完Unity IAP文档后,我完全迷路了。它假定人们了解IAP交易原理。

0 个答案:

没有答案