游戏内购服务 Market Exchange Service

  • Class :MarketExchangeService

服务对象 Service Object
此对象为服务对象,可以使用GetService()函数获取此服务。Use GetService() to use this service.

不可创建 Cannot create
无法使用RWObject:New(Classname)创建此对象,也不在编辑器对象列表中显示。Cannot use RWObject:New(Classname) to create this object, it will not display in editor object list either.

不在编辑器管理器中显示 Will not display in editor.

描述 Description

-此功能暂未开放
便于制作者在游戏中放置内购商品以及订阅等,从编辑器左侧功能栏中点选内购服务按钮,即可开始设置内购商品。
This function is not available yet.
It makes the game convenient for developers to place in-app purchases and subscriptions. Click the in-app purchase button on the left of editor to purchase items.

目前提供两种内购商品,普通内购商品和订阅商品。
Currently offers two kinds of in-app purchase, common and subscription.

普通内购商品属于消耗类物品,可不断地重复购买。
Common purchases can be repurchased as they are consumables.

订阅商品属于在一段时间内一次性购买的商品,购买后会获得永久(或长期)使用权。此类商品在其使用期内不可重复购买。
Subscription purchases are one time purchases. These items are available to use long term or permanently. Subscription items cannot be repurchased.

  • 如何创建内购商品
    首先需要打开一个已发布的项目,选择需要创建的内购商品类型,点击加号按钮后在弹出框内填写商品信息,点击确定即可完成创建。

  • How to create in-app purchase items
    Open a published project, select the type of in-app purchase items. Click the add button then fill in the item information in the pop up window.

  • 如何使用内购商品
    商品创建成功后会在左侧商品列表中显示,创作者可从此处看到商品的唯一ID,并且可以在项目中通过脚本调用ID。

  • How to use in-app purchase items
    After creating the items, they will appear in the item list on the left. Developer can see the ID of the item and call this item in script.

  • 如何编辑内购商品
    在左侧商品列表中点击想要编辑的商品,可在下拉菜单中选择配置、下架和删除三个选项。

  • How to edit items
    On the left side of the item list, click the item you want to edit, and choose configuration, remove, or delete in the drop down menu.

  • 注意事项
    1.只能在发布过的项目中创建内购商品。
    2.内购商品不能跨项目调用,只能在其创建的项目内调用。

  • Notice

  1. In-app purchase items can be created only in published projects.
  2. In-app purchase items cannot be transferred to other projects.

函数 Functions

    GetProductsInfo()
    返回当前游戏的所有游戏商品Product的信息
    Return all current item information.

    GetSubscriptionsInfo()
    返回当前游戏的所有游戏订阅Subscription的信息
    return all subscription item information.

    GetCommodityInfo(Id,InfoType)
    该函数根据输入的参数,Id和InfoType,找到对应的商品,然后返回该物品的信息表
    Based on input parameters, ID and InfoType, this function will find the corresponding item and return its information chart.

    AcquireSubscription(Player,SubscriptionId)
    该函数向Player对象弹窗提示购买ID为SubscriptionId的游戏订阅
    This function will inform players of SubscriptionId with a pop up window.

    AcquireProduct(Player,ProductId)
    该函数向Player对象提示去购买ID为ProductId的游戏商品
    This function will prompt players to purchase ProductId.

    AcquireAsset(Player,AssetId)
    该函数向Player对象提示去购买ID为AssetId的外装
    This function will prompt player to purchase AssetId.

    PlayerOwnsAsset(Player,ProductId)
    该函数根据玩家对象Player和外装ID,检测该玩家是否含有该外装,然后返回Bool值,true为有该外装
    Based on the player’s AssetId, the function will check if the player has the asset and return Bool value with true as asset owned.

    UserOwnsSubscription(UserId,SubscriptionId)
    该函数检测ID为UserId的用户是否拥有ID为SubscriptionId的游戏订阅
    This function checks UserId if player has SubscriptionId.

    ProcessReceipt(functionReceiptInfo)
    当玩家通过AcquireProduct(Player,ProductId) 引起的弹窗购买Product时这个事件被触发,回调函数被调用
    This function is triggered when player purchases items with pop up windown from AcquireProduct(Player,ProductId).

事件 Events

    AcquireSubscriptionFinished(Player,SubscriptionId,wasPurchased)
    当购买游戏订阅的弹窗关闭或玩家取消购买或购买失败时,本事件触发
    This event is triggered when subscription pop up window closes or when player cancels purchase or purchase failed.

    AcquireProductFinished(Player,ProductId,wasPurchased)
    当购买游戏商品的弹窗关闭或玩家取消购买或购买失败时,本事件触发
    This event is triggered when item purchase window closes or when player cancels purchase or purchase failed.

    AcquireAssetFinished(Player,AssetId,wasPurchased)
    当购买外装的弹窗关闭或玩家取消购买或购买失败时,本事件触发
    This event is triggered when asset purchasewindow closes or when player cancels purchase or purchase failed.

    SubscriptionTimeOut(Player,SubscriptionId)
    给限时订阅注册本事件
   

文档更新时间: 2020-10-07 02:40   作者:孙晓艺