using PlayNANOO;
public class PlayNANOOExample : MonoBehaviour
{
Plugin plugin;
void Awake()
{
plugin = Plugin.GetInstance();
}
// 자신의 우편함에 아이템을 지급하는 경우
public void ItemSend()
{
string tableCode = "TABLE_CODE";
int period = 365;
List<PlayNANOO.Inbox.ItemValueModel> items = new List<PlayNANOO.Inbox.ItemValueModel>();
List<PlayNANOO.Inbox.MessageValueModel> messages = new List<PlayNANOO.Inbox.MessageValueModel>();
items.Add(new PlayNANOO.Inbox.ItemValueModel { item_code = "ITEM_CODE_1", item_count = 10 });
items.Add(new PlayNANOO.Inbox.ItemValueModel { item_code = "ITEM_CODE_2", item_count = 20 });
// 기본 언어 Configure.PN_LANG_CODE_DEFAULT 는 필수 입니다.
messages.Add(new PlayNANOO.Inbox.MessageValueModel { language = Configure.PN_LANG_CODE_DEFAULT, title = "TEST", content = "TEST" });
messages.Add(new PlayNANOO.Inbox.MessageValueModel { language = Configure.PN_LANG_CODE_KO, title = "TEST", content = "TEST" });
plugin.InboxManager.SendItem(tableCode, items, messages, period, (status, error, jsonString, values) =>
{
if(state.Equals(Configure.PN_API_STATE_SUCCESS)) {
Debug.Log("Success");
} else {
Debug.Log("Fail");
}
});
}
// 다른 플레이어 우편함에 아이템을 지급(선물) 하는 경우
public void ItemSendPlayer()
{
string tableCode = "TABLE_CODE";
string playerId = "PLAYER_ID";
int period = 365;
List<PlayNANOO.Inbox.ItemValueModel> items = new List<PlayNANOO.Inbox.ItemValueModel>();
List<PlayNANOO.Inbox.MessageValueModel> messages = new List<PlayNANOO.Inbox.MessageValueModel>();
items.Add(new PlayNANOO.Inbox.ItemValueModel { item_code = "ITEM_CODE_1", item_count = 10 });
items.Add(new PlayNANOO.Inbox.ItemValueModel { item_code = "ITEM_CODE_2", item_count = 20 });
// 기본 언어 Configure.PN_LANG_CODE_DEFAULT 는 필수 입니다.
messages.Add(new PlayNANOO.Inbox.MessageValueModel { language = Configure.PN_LANG_CODE_DEFAULT, title = "TEST", content = "TEST" });
messages.Add(new PlayNANOO.Inbox.MessageValueModel { language = Configure.PN_LANG_CODE_KO, title = "TEST", content = "TEST" });
plugin.InboxManager.SendItemPlayer(tableCode, playerId, items, messages, period, (status, error, jsonString, values) =>
{
if(state.Equals(Configure.PN_API_STATE_SUCCESS)) {
Debug.Log("Success");
} else {
Debug.Log("Fail");
}
});
}
}