物品

物品

只需定义一次物品,即可管理每位玩家的背包。

免费开始使用

物品

只需定义一次物品,即可管理每位玩家的背包。

SDK 与 REST

与 Unity、Godot 或 Unreal 集成,或使用 REST 接口。

项目控制台

在项目中配置各项功能并管理当前数据。

快速集成

快速集成

物品
视频即将上线

为所选项目管理独立装备、属性、目录规则与玩家背包。

快速集成
Unity (C#)
using UnityEngine;
using PM.horizOn.Cloud.Manager;

public sealed class ItemsDemo : MonoBehaviour
{
    // Initialize/connect and restore the existing player in the Quickstart first.
    public async void ReadInventory()
    {
        var user = UserManager.Instance.CurrentUser;
        if (user == null || !user.IsValid()) return;
        var result = await ItemsManager.Instance.GetInventory(user.UserId);
        if (!result.IsSuccess) { Debug.LogWarning(result.ErrorCode); return; }
        foreach (var item in result.Data.instances)
            Debug.Log($"{item.instanceId}: {item.itemKey}");
        // Keep result.Data.revision for a separately reviewed mutation.
    }

    // Wire a separate explicit action; no automatic catalog traversal or poll.
    public async void ReadCatalogPage()
    {
        var user = UserManager.Instance.CurrentUser;
        if (user == null || !user.IsValid()) return;
        var result = await ItemsManager.Instance.GetCatalog(user.UserId, limit: 1);
        if (!result.IsSuccess) { Debug.LogWarning(result.ErrorCode); return; }
        Debug.Log($"Catalog revision: {result.Data.revision}");
        // Explicit Next keeps result.Data.revision and nextAfterKey unchanged.
    }
}
// SDK ItemsExample/ItemsSampleStore persist original instanceId/body/revision before writes.
// Keep the original Player Values operationId for purchase recovery.
// The initial success may include item references; retained replay may return empty applied/items.
// Read the current inventory separately. Never reconstruct earlier item references.
// A failed refresh never authorizes a replacement purchase or a local item grant.

此 SDK 示例使用 develop。请检查已安装的 SDK 是否具备所需 API。 参见快速入门

常见问题

常见问题

准备好开始集成了吗?

今天就开始使用 horizOn 构建你的游戏后端,免费套餐开箱即用。