재화 초기화
플레이어의 재화를 초기화 합니다.
호출 정보
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 |