Exemplo n.º 1
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Return))
     {
         if (textInput.text != string.Empty)
         {
             string     text       = textInput.text;
             string     name       = playerNameInput.text;
             NewMsgJSON NewMsgJSON = new NewMsgJSON(name, text);
             ChattingUpdate(name, text);
             socket.Emit("newMsg", new JSONObject(JsonUtility.ToJson(NewMsgJSON)));
             textInput.text = string.Empty;
         }
     }
 }
Exemplo n.º 2
0
    void OnNewMsg(SocketIOEvent socketIOEvent)
    {
        NewMsgJSON msgJSON = NewMsgJSON.CreateFromJSON(socketIOEvent.data.ToString());

        ChattingUpdate(msgJSON.name, msgJSON.text);
    }