본문으로 건너뛰기

재화 등록

플레이어의 재화를 등록 합니다.

호출 정보

public void Put (List<ItemModel> items, PlayNANOODelegate callback) {}

호출 상세 정보

파라미터설명타입
items재화 정보List<ItemModel>
callback통신 결과PlayNANOODelegate

소스 코드

using PlayNANOO;

public class PlayNANOOExample : MonoBehaviour
{
Plugin plugin;

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

List<PlayNANOO.Currency.ItemModel> currencyItems = new List<PlayNANOO.Currency.ItemModel>();
currencyItems.Add(new PlayNANOO.Currency.ItemModel { currency_code = "CURRENCY_CODE", currency_amount = 100 });
currencyItems.Add(new PlayNANOO.Currency.ItemModel { currency_code = "CURRENCY_CODE", currency_amount = 100 });

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

통신 결과 상세 정보

데이터키설명타입
items.currency_code재화 코드string
items.currency_amount보유 재화double