c# - Unity IAP:如何编写脚本来为当前版本的 Unity 提供无代码 IAP 功能?
问题描述
我想实现无代码 IAP,人们可以在 Mac App Store 中购买非消耗性 Unity 应用程序。
我正在使用2017.4.27f。Codeless 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 提供的产生错误的脚本。
如果这些错误已得到纠正,此脚本能否与当前版本的 Unity for IAP 一起使用?
我已经搜索了几天以获取有关 Unity IAP 的更多最新信息。我只找到了向人们展示如何创建 Unity IAP 按钮并使用 Debug.log 语句为已完成的购买和失败的购买创建过程的视频。他们都没有提供可以用作学习这些东西的起点的示例脚本。
引用的 Unity 教程也很旧。我得到同样的错误。
https://unity3d.com/learn/tutorials/topics/ads-analytics/integrating-unity-iap-your-game
我在这里或游戏开发堆栈交换中没有找到任何涉及基本 Unity IAP 信息的问题。
我找不到来自 Unity 的最新教程。
看完 Unity IAP 文档后,我完全迷失了。它假设人们了解 IAP 交易如何运作的基础知识。
解决方案
推荐阅读
- java - 如何在改造中处理错误空体?
- python-3.x - 在三重高斯拟合期间,初始猜测值和高卡方值相差很大
- json - 斯威夫特,无法读取数据,因为它的格式不正确
- linux - 在 WSL2 openSUSE-Leap-15.2 环境中,为 xrdp 和 systemd-modules-load / auditd 正确设置 sudoers 用户/会话失败
- relational-database - Loopback 4删除关系
- python-3.x - python 3 if..elif 不会打印
- c++ - C++:从 txt 文件读取输出问题
- php - 在 woocommerce 中按自定义库存状态过滤
- c# - C# 如何在 String.Contains 方法中添加更多标点符号?
- c# - C#/SQL Server:如何在允许另一个用户无缝访问数据的同时重复锁定/截断/更新表