private void GetUserData(ARWObject obj, object value) { if (obj.GetString("error") == "") { // AppManager.instance.screenView.Transition(2); AppManager.instance.InitPlayer(obj.GetString("player_data")); } else { Debug.Log("GetUserData Error : " + obj.GetString("error")); } }
private void SendMessageHandler(ARWObject obj, object value) { string messageData = obj.GetString("message_data"); Debug.Log(messageData); Message newMessage = new Message(new JSONObject(messageData)); Talk currentTalk = ChatPanelManager.instance.user.playerTalks.Where(a => a.talkId == newMessage.talkId).FirstOrDefault(); Debug.Log("=======> " + newMessage.body + " : " + newMessage.talkId); if (currentTalk == null) { return; } currentTalk.AddMessage(newMessage); }
private void FindedConversationHandler(ARWObject obj, object value) { string newTalkData = obj.GetString("talk_data"); JSONObject talkJson = new JSONObject(newTalkData); Talk newTalk = new Talk(talkJson); if (newTalk.receiverName == "") { DialogManager.ShowAlert("Server connection error.", "Alert!", MaterialIconHelper.GetIcon(MaterialIconEnum.ADD_ALERT)); return; } ChatPanelManager.instance.user.AddTalk(newTalk); ChatPanelManager.instance.InitNewTalk(newTalk); Debug.Log(newTalk.talkId + " : " + newTalk.receiverName + " : " + newTalk.talkMessages.Length); }