简体   繁体   中英

Using SignalR 2x in unity3d

I want to use SignalR to communicate between Unity Game and a server on the same machine. I tried Nivot,SignalR.Client.Net35 but it gives me the following error:

Could not install package 'Nivot.SignalR.Client.Net35 2.0.0'. You are trying to install this package into a project that targets      '.NETFramework,Version=v3.5,Profile=Unity Subset v3.5', but the package does not contain any assembly references or content files that are compatible with that framework.

First Question: Why am I getting this error? both the package and unity are using .Net 3.5, thus, should be compatible.


I tried to skip that library and used SignalR.Client.20 instead; it seems to import correctly, but uses Protocol 1.2, and I cannot rollback my server to 1.x because my universal app client is on 2.x

Second Question: is there a .net SignalR 2.x library I can use in unity3d?

Third Question: unity3d seems to use a variation of Javascript called Unityscript , how can I use Javascript SignalRJs libraries inside it?

TL;DR: Can I get any answer on how to run SignalR client 2.x on Unity3D?

Thanks,

First Question: while Unity claims to use Mono .Net 3.5, it's a slightly modified framework and isn't exactly the same as vanilla .net 3.5

Second Question: So SignalR is backward compatible, and the protocol 1.x and 2.x were compatible. I ended up using SignalR.Client2.00 . I got a code sample from a german blog

I still did not figure out the third Question

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM