itisnajim / SocketIOUnity

A Wrapper for socket.io-client-csharp to work with Unity.
MIT License
406 stars 69 forks source link

SocketIOResponse could not be found #76

Closed frostfire1 closed 1 week ago

frostfire1 commented 10 months ago

I try to get json response using SocketIOResponse but unity can't find it

error CS0246: The type or namespace name 'SocketIOResponse' could not be found (are you missing a using directive or an assembly reference?) socket.On("updatePlayerMovement", (SocketIOResponse response) => { UpdateOtherPlayerMovement(response); });

itisnajim commented 8 months ago

omit the type for now, and for UpdateOtherPlayerMovement args use directly the values needed instead of the whole response, e.g:

socket.On("updatePlayerMovement", (response) =>
{
    var playerPosition = response.GetValue<PlayerPosition>();
    UpdateOtherPlayerMovement(playerPosition)
});
frostfire1 commented 7 months ago

okay its work