文档

​
​

Development

User Acquisition

Monetization

工业

Economy

Economy

LiveOps
​
​
Economy
  • Overview
  • Get started
  • Concepts
  • Tutorials
  • Reference
    • Economy SDK guide
      • Installation
      • Configuration
      • Common objects
      • Player balances
      • Player inventory
      • Purchases
      • Editor tools
      • Exceptions
      • Quick reference
      • Game Overrides
    • Parameters of operation
  • Privacy and consent
  1. Economy
  2. Economy SDK 指南

快速参考

View a quick reference guide for all available Economy SDK methods.
阅读时间3 分钟
最后更新于 8 个月前

以下是 SDK 中可用方法的快速参考。有关更详细的信息,请参阅各命名空间的文档。

配置

通过
Configuration
命名空间中的方法,可以从全局经济配置中检索物品。
有关这些方法的更多详细信息,请参阅 SDK 配置。
可用的方法有:
public async Task<List<ConfigurationItemDefinition>> SyncConfigurationAsync();public List<CurrencyDefinition> GetCurrencies()public CurrencyDefinition GetCurrency(string id)public List<InventoryItemDefinition> GetInventoryItems()public InventoryItemDefinition GetInventoryItem(string id)public List<VirtualPurchaseDefinition> GetVirtualPurchases()public VirtualPurchaseDefinition GetVirtualPurchase(string id)public List<RealMoneyPurchaseDefinition> GetRealMoneyPurchases()public RealMoneyPurchaseDefinition GetRealMoneyPurchase(string id)

玩家余额

使用
PlayerBalances
命名空间中的方法,可以检索和更新用户的货币余额。这些方法将从 Authentication SDK 返回当前登录玩家的余额。
有关这些方法的更多详细信息,请参阅玩家余额。
可用的方法有:
public async Task<GetBalanceResponse> GetBalancesAsync(GetBalancesOptions options = null)public async Task<PlayerBalanceDefinition> SetBalanceAsync(string currencyId, int balance, SetBalanceOptions options = null)public async Task<PlayerBalanceDefinition> IncrementBalanceAsync(string currencyId, int amount, IncrementBalanceOptions options = null)public async Task<PlayerBalanceDefinition> DecrementBalanceAsync(string currencyId, int amount, DecrementBalanceOptions options = null)

玩家背包

使用
PlayerInventory
命名空间中的方法,可以检索和更新玩家的背包实例。这些方法将从 Authentication SDK 返回当前登录玩家的背包数据。
有关这些方法的更多详细信息,请参阅玩家背包。
可用的方法有:
public async Task<GetInventoryResult> GetInventoryAsync(GetInventoryOptions options = null)public async Task<PlayerInventoryInstance> AddInventoryItemAsync(string inventoryItemId, AddInventoryItemOptions options = null)public async Task<PlayerInventoryInstance> UpdateInventoryInstanceAsync(string playersInventoryItemId, Dictionary<string, object> instanceData, UpdatePlayersInventoryItemOptions options = null)public async Task DeleteInventoryInstanceAsync(string playersInventoryItemId, DeletePlayersInventoryItemOptions options = null)

购买

使用
Purchases
命名空间中的方法,您可以进行虚拟购买并为玩家兑换真实货币购买的商品。这些方法为当前使用 Authentication SDK 登录的玩家进行购买。
有关这些方法的更多详情,请参阅购买。
可用的方法有:
public async Task<MakeVirtualPurchaseResult> MakeVirtualPurchaseAsync(string virtualPurchaseId, MakeVirtualPurchaseOptions options = null)public async Task<RedeemAppleAppStorePurchaseResult> RedeemAppleAppStorePurchaseAsync(RedeemAppleAppStorePurchaseArgs args)public async Task<RedeemGooglePlayPurchaseResult> RedeemGooglePlayPurchaseAsync(RedeemGooglePlayStorePurchaseArgs args)

Copyright © 2026 Unity Technologies
法律信息隐私政策CookiesDocumentation Terms of Use请勿出售或分享我的个人信息您的隐私选择(Cookie 设置)

“Unity”、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属公司在美国和其他地方的商标或注册商标(此处查看更多信息)。其他名称或品牌是其各自所有者的商标。

为方便起见,一些页面是机器翻译的,可能包含不准确的内容。如有信息不一致的情况,以英文版本为准。

  • 在本页上
    • 配置

    • 玩家余额

    • 玩家背包

    • 购买


报告此页面的问题