pusher / pusher-websocket-dotnet

Pusher Channels Client Library for .NET
MIT License
112 stars 113 forks source link

How to load this package into Unity? #65

Closed Jordanirabor closed 4 years ago

Jordanirabor commented 5 years ago

I have some issues adding this package into Unity. My method was to install it using Visual Studio and moving the .dll file to the Assets/Plugins folder of Unity. I'm not sure if this is the right way because it throws several errors.

Please help.

Jordanirabor commented 5 years ago

Could someone please write a simple walkthrough?

Jordanirabor commented 5 years ago

This is the error I get:

Assembly 'Assets/Plugins/PusherClient.dll' will not be loaded due to errors: Unable to resolve reference 'WebSocket4Net'. Is the assembly missing or incompatible with the current platform? Reference validation can be disabled in the Plugin Inspector. Unable to resolve reference 'Newtonsoft.Json'. Is the assembly missing or incompatible with the current platform? Reference validation can be disabled in the Plugin Inspector. Unable to resolve reference 'SuperSocket.ClientEngine'. Is the assembly missing or incompatible with the current platform?

Jordanirabor commented 5 years ago

When I finally added all of those DLLs as references in an msc.rsp file. I get two new errors:

  1. Unloading broken assembly Assets/Plugins/PusherClient.dll, this assembly can cause crashes in the runtime

  2. TypeLoadException: Invalid type PusherClient.Connection for instance field PusherClient.Pusher:_connection

reneaye commented 5 years ago

+1 a walkthrough would be very appreciated. I found no way of running this lib within Unity. tried with building dlls and by using source code.

virtouso commented 5 years ago

@damdo another problem is i cant use it in unity3d. as unity3d does not support nuget. i have to manullay find dll and put it in unity3d. when i use the dll file in assets i receive this error:

Assembly 'Assets/PusherClient.dll' will not be loaded due to errors: Unable to resolve reference 'WebSocket4Net'. Is the assembly missing or incompatible with the current platform? Reference validation can be disabled in the Plugin Inspector. Unable to resolve reference 'SuperSocket.ClientEngine'. Is the assembly missing or incompatible with the current platform? Reference validation can be disabled in the Plugin Inspector.

i tested this on both android and windows target platform. is this realy tested on unity3d?

damdo commented 5 years ago

Hey people, thank you for reporting your issues with the Unity integration. These past weeks we worked on a better integration between Pusher Channels and Unity.

On this note, today I've released a new repository that will be the reference for developers willing to integrate Pusher Channels with Unity: https://github.com/pusher/pusher-websocket-unity 🎉

The pusher-websocket-unity repository will serve as:

From now on I'd suggest to keep the conversations on Unity there. Thank you ✨ Dam

virtouso commented 5 years ago

great man. very glad to hear that. thanks. ill test it and tell you my results @damdo

virtouso commented 5 years ago

well done. it works like a charm.

damdo commented 4 years ago

Closing this issue as Unity is now officially supported by Pusher Channels through https://github.com/pusher/pusher-websocket-unity as mentioned here https://github.com/pusher/pusher-websocket-dotnet/issues/65#issuecomment-520495111