文档

自定义商店模块

通过自定义商店模块扩展自定义商店的购买功能。
阅读时间1 分钟最后更新于 3 个月前

Store 模块扩展了
AbstractPurchasingModule
类。商店模块充当工厂,Unity IAP 使用这些工厂来获取商店实例以及任何配置和扩展。
一个模块可以支持多个商店。
StandardPurchasingModule
类处理 IAP 的所有默认商店实现。
要将自定义商店实现与 Unity 提供的默认商店一起使用,开发者可以向 IAP 提供多个模块:
ConfigurationBuilder.Instance (MyCustomModule.Instance(), StandardPurchasingModule.Instance ());
向
ConfigurationBuilder
类提供多个模块时,请按照 IAP 必须用于给定平台可用实现的优先级顺序列出模块。在代码示例中,
MyCustomModule
类提供的任何实现都优先于
StandardPurchasingModule
类。