본문으로 건너뛰기

재화 초기화

플레이어의 재화를 초기화 합니다.

호출 정보

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