Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Read Json data from the command prompt

Discussion in 'Editor & General Support' started by fsok, May 11, 2017.

  1. fsok

    fsok

    Joined:
    Apr 11, 2017
    Posts:
    2
    Hi !

    I have a server script write in javascript that use socket.io.

    Code (JavaScript):
    1. ioPy.sockets.on('connection', function (socket) {
    2.     socket.on('data_available', function(parameter, data, callback) {
    3.         console.log(data);
    4.         var jsonData = JSON.stringify(data);
    5.         console.log(jsonData);
    6.         if(DEBUG) { console.log(parameter); }
    7.         io.emit(parameter, jsonData);
    8.     });
    9. });
    That script send json data to the command prompt.

    And I would like to know how can I read this json data from the command prompt in my unity poject by a c# script ? For example display it in the console.

    I already use Litjson, Socket.io asset (which is deprecated)...

    Thank you !
     
unityunity