Giter VIP home page Giter VIP logo

Comments (5)

itisnajim avatar itisnajim commented on May 25, 2024

https://github.com/itisnajim/SocketIOUnity#receiving

from socketiounity.

rihno123 avatar rihno123 commented on May 25, 2024

https://github.com/itisnajim/SocketIOUnity#receiving

Can you be more detailed? I don't get it.

from socketiounity.

itisnajim avatar itisnajim commented on May 25, 2024

@rihno123, to retrieve your object, it is recommended to use the GetValue method. For example, to get an object of type 'SomeClass':

var obj = response.GetValue<SomeClass>();

If the object is a string, you can use:

string text = response.GetValue<string>();

Alternatively, if you wish to view the object as a stringified JSON, you can use:

string jsonStr = response.GetValue(0).GetRawText();

from socketiounity.

rihno123 avatar rihno123 commented on May 25, 2024

@rihno123, to retrieve your object, it is recommended to use the GetValue method. For example, to get an object of type 'SomeClass':

var obj = response.GetValue<SomeClass>();

If the object is a string, you can use:

string text = response.GetValue<string>();

Alternatively, if you wish to view the object as a stringified JSON, you can use:

string jsonStr = response.GetValue(0).GetRawText();

Ok, but when I use that line I get this error.
Capture

from socketiounity.

SatoshiDark avatar SatoshiDark commented on May 25, 2024

Hi, I have the same issue as the first screenshot, I'm at Unity version 2021.3.17f1.
I imported the package without issues, but when I copied the sample folder then the unity console log shows that error.
As I'm just testing this package for the GGJ, I replaced the error line response.GetValue().GetRawText() with response.ToString() and seems to work, but I'll really appreciated if you can update the sample directory please.
Thanks!

from socketiounity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.