Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in unity #42

Open
rihno123 opened this issue Jan 16, 2023 · 5 comments
Open

Issue in unity #42

rihno123 opened this issue Jan 16, 2023 · 5 comments

Comments

@rihno123
Copy link

Hi, I have this issue.
Capture
1

@itisnajim
Copy link
Owner

@rihno123
Copy link
Author

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

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

@itisnajim
Copy link
Owner

@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();

@rihno123
Copy link
Author

@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

@SatoshiDark
Copy link

SatoshiDark commented Jan 30, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants