快速参考
View a quick reference guide for all available Economy SDK methods.
阅读时间2 分钟最后更新于 15 天前
以下是 SDK 中可用方法的快速参考。有关更详细的信息,请参阅各命名空间的文档。
配置
通过Configurationpublic 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)
玩家余额
使用PlayerBalancespublic 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)
玩家背包
使用PlayerInventorypublic 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)
购买
使用Purchasespublic async Task<MakeVirtualPurchaseResult> MakeVirtualPurchaseAsync(string virtualPurchaseId, MakeVirtualPurchaseOptions options = null)public async Task<RedeemAppleAppStorePurchaseResult> RedeemAppleAppStorePurchaseAsync(RedeemAppleAppStorePurchaseArgs args)public async Task<RedeemGooglePlayPurchaseResult> RedeemGooglePlayPurchaseAsync(RedeemGooglePlayStorePurchaseArgs args)