首页 文章

在unity3d中使用SignalR 2x

提问于
浏览
0

我想使用SignalR在Unity Game和同一台机器上的服务器之间进行通信 . 我试过了 Nivot,SignalR.Client.Net35 但它给了我以下错误:

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: 为什么我收到此错误?包和统一都使用.Net 3.5,因此,应该是兼容的 .


我试图跳过该库并使用SignalR.Client.20代替;它似乎导入正确,但使用协议1.2,我无法将我的服务器回滚到1.x,因为我的通用应用程序客户端在2.x

Second Question: 有一个.net SignalR 2.x库我可以在unity3d中使用吗?

Third Question: unity3d似乎使用了一个名为Unityscript的Javascript变种,我怎么能在里面使用Javascript SignalRJs库呢?

TL;DR: 我可以得到关于如何在Unity3D上运行SignalR client 2.x的任何答案吗?

谢谢,

1 回答

  • 0

    First Question: 虽然Unity声称使用Mono .Net 3.5,但它与香草.net 3.5完全相同

    Second Question: 因此SignalR是向后兼容的,协议1.x和2.x是兼容的 . 我最终使用了SignalR.Client2.00 . 我从german blog获得了一个代码示例

    我还是没弄明白 third Question

相关问题