跳转到主要内容

查询全部货币

查询玩家持有的游戏内全部货币信息。

调用信息

CurrencyAll(PlayNANOODelegate callback) {}

调用详细信息

参数说明类型
callback通信结果PlayNANOODelegate

源代码

using PlayNANOO;

public class PlayNANOOExample : MonoBehaviour
{
Plugin plugin;

void Awake()
{
plugin = Plugin.GetInstance();

plugin.CurrencyManager.All((status, errorMessage, jsonString, values) => {
if (status.Equals(Configure.PN_API_STATE_SUCCESS))
{
PlayNANOO.Currency.ItemModel[] items = values["Items"] as PlayNANOO.Currency.ItemModel[];

foreach(PlayNANOO.Currency.ItemModel item in items)
{
Debug.Log(item.currency_code);
Debug.Log(item.currency_amount);
}
}
else
{
Debug.Log("Fail");
}
});
}
}

通信结果

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"items" : [
{
"currency": "CurrencyCode",
"amount": 100
}
]
}

通信结果详细信息

数据键说明类型
items.currency货币代码string
items.amount持有货币double