跳转到主要内容

货币初始化

初始化玩家的货币。

调用信息

public void Init (PlayNANOODelegate callback){};

调用详细信息

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

源代码

using PlayNANOO;

public class PlayNANOOExample : MonoBehaviour
{
Plugin plugin;

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

plugin.CurrencyManager.Init((status, error, 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_code": "GD",
"currency_amount": "1"
},
{
"currency_code": "DA",
"currency_amount": "1"
}
]
}

通信结果详细信息

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