psygame / Unitywebsocket
Licence: other
🐳 The Best Unity WebSocket Plugin for All Platforms.
Stars: ✭ 191
Projects that are alternatives of or similar to Unitywebsocket
Herebedragons
A basic 3D scene implemented with various engines, frameworks or APIs.
Stars: ✭ 1,616 (+746.07%)
Mutual labels: unity, webgl
Workerman
An asynchronous event driven PHP socket framework. Supports HTTP, Websocket, SSL and other custom protocols. PHP>=5.3.
Stars: ✭ 9,617 (+4935.08%)
Mutual labels: websocket, socket
Unity Webxr Export
Develop and export WebXR experiences using Unity WebGL
Stars: ✭ 130 (-31.94%)
Mutual labels: unity, webgl
3d Game Shaders For Beginners
🎮 A step-by-step guide to implementing SSAO, depth of field, lighting, normal mapping, and more for your 3D game.
Stars: ✭ 11,698 (+6024.61%)
Mutual labels: unity, webgl
Clusterws Client Js
🔥 JavaScript Client for ClusterWS - lightweight, fast and powerful framework for building scalable WebSocket applications in Node.js.
Stars: ✭ 120 (-37.17%)
Mutual labels: websocket, socket
Bigq
Messaging platform in C# for TCP and Websockets, with or without SSL
Stars: ✭ 18 (-90.58%)
Mutual labels: websocket, socket
Jstp
Fast RPC for browser and Node.js based on TCP, WebSocket, and MDSF
Stars: ✭ 132 (-30.89%)
Mutual labels: websocket, socket
Toho Like Js
Touhou style danmaku shooter game which runs on your chrome.
Stars: ✭ 127 (-33.51%)
Mutual labels: webgl, websocket
Unitystandalonefilebrowser
A native file browser for unity standalone platforms
Stars: ✭ 1,002 (+424.61%)
Mutual labels: unity, webgl
Mean Angular4 Chat App
MEAN stack with Angular 4 Chat App
Stars: ✭ 41 (-78.53%)
Mutual labels: websocket, socket
Socketcluster Server
Minimal server module for SocketCluster
Stars: ✭ 70 (-63.35%)
Mutual labels: websocket, socket
Clusterws
💥 Lightweight, fast and powerful framework for building scalable WebSocket applications in Node.js
Stars: ✭ 868 (+354.45%)
Mutual labels: websocket, socket
Beetlex
high performance dotnet core socket tcp communication components, support TLS, HTTP, HTTPS, WebSocket, RPC, Redis protocols, custom protocols and 1M connections problem solution
Stars: ✭ 802 (+319.9%)
Mutual labels: websocket, socket
Uiwidgets
UIWidget is a Unity Package which helps developers to create, debug and deploy efficient, cross-platform Apps.
Stars: ✭ 1,901 (+895.29%)
Mutual labels: unity, webgl
在线示例
快速开始
安装环境
- Unity 2018.3 或更高。
- 无其他SDK依赖。
安装方法
-
通过 OpenUPM 安装
插件已托管至 OpenUPM ,您可以使用 openupm package installer 进行安装。
-
通过 Git 安装
在您的项目根路径的
Packages
文件夹中找到manifest.json
文件,参考如下方式进行修改:{ "dependencies": { "com.psygame.unitywebsocket": "https://github.com/psygame/UnityWebSocket.git", ... }, }
可通过修改链接后缀
#{version}
来安装对应版本。- 示例:
"com.psygame.unitywebsocket": "https://github.com/psygame/UnityWebSocket.git#2.3.0",
- 示例:
-
通过 Unity Package 安装
在 Releases 页面中,下载对应版本的
UnityWebSocket.unitypackage
安装包,然后导入到您的项目中。
使用方法
-
代码示例
// 命名空间 using UnityWebSocket; // 创建实例 string address = "ws://echo.websocket.org"; WebSocket socket = new WebSocket(address); // 注册回调 socket.OnOpen += OnOpen; socket.OnClose += OnClose; socket.OnMessage += OnMessage; socket.OnError += OnError; // 连接 socket.ConnectAsync(); // 发送数据(两种方式) socket.SendAsync(str); // 发送 string 类型数据 socket.SendAsync(bytes); // 发送 byte[] 类型数据 // 关闭连接 socket.CloseAsync();
-
详细使用方法可参考项目中的 UnityWebSocketDemo.cs 示例代码。
注意(Warning)
-
插件中多个命名空间中存在 WebSocket 类,适用不同环境,请根据自身需求选择。
命名空间 平台 方式 说明 UnityWebSocket 全平台 同步(无阻塞) [推荐] 无需考虑异步回调使用 Unity 组件的问题。 UnityWebSocket.Uniform 全平台 异步 需要考虑异步回调使用 Unity 组件的问题。 UnityWebSocket.WebGL WebGL平台 异步 仅支持WebGL平台下的通信。 UnityWebSocket.NoWebGL 非WebGL平台 异步 仅支持非WebGL平台下的通信。
QQ 交流群
- 1126457634 >>> 入群通道 <<<
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].