Skip to content

Commit 1a94544

Browse files
committed
Merge branch 'develop'
2 parents 6094909 + 5136209 commit 1a94544

File tree

82 files changed

+5141
-1492
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+5141
-1492
lines changed

README.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
```csharp
2424
// 命名空间
2525
using UnityWebSocket;
26-
using UnityWebSocket.Synchronized;
2726

2827
// 创建实例
2928
WebSocket scoket = new WebSocket();
@@ -46,15 +45,15 @@
4645
socket.CloseAsync();
4746
```
4847

49-
- 详细使用方法可参考项目中的 [Example](UnityWebSocket/Assets/Scripts/Plugins/UnityWebSocket/Example/TestWebSocket.cs) 示例代码。
48+
- 详细使用方法可参考项目中的 [Example.cs](UnityWebSocket/Assets/UnityWebSocket/Example/Example.cs) 示例代码。
5049

5150
#### 3. 注意(Warning)
5251

5352
- 插件中多个命名空间中存在 **WebSocket** 类,适用不同环境。
5453

5554
命名空间 | 平台 | 方式 | 说明
5655
-|-|-|-
57-
UnityWebSocket.Synchronized | 全平台 | 同步(无阻塞) | **[推荐]** 无需考虑异步回调使用 Unity 组件的问题。
56+
UnityWebSocket | 全平台 | 同步(无阻塞) | **[推荐]** 无需考虑异步回调使用 Unity 组件的问题。
5857
UnityWebSocket.Uniform | 全平台 | 异步 | 需要考虑异步回调使用 Unity 组件的问题。
5958
UnityWebSocket.WebGL | WebGL平台 | 异步 | 仅支持WebGL平台下的通信。
6059
UnityWebSocket.NoWebGL | 非WebGL平台 | 异步 | 仅支持非WebGL平台下的通信。
@@ -63,14 +62,9 @@
6362

6463
- WebSocket.jslib 语法格式需要遵循 [asm.js](http://www.ruanyifeng.com/blog/2017/09/asmjs_emscripten.html)
6564

66-
路径:Plugins/WebSocketJS/WebSocketJS.jslib
65+
路径:Plugins/WebGL/WebSocket.jslib
6766
作用:Unity发布WebGL版本会将其加入到js运行库中。
6867

69-
- WebSocketReceiver.cs
70-
71-
作用:与 jslib 交互,负责收发多个WebSocket消息。
72-
该脚本在使用WebSocket时会自动加载到场景中,并添加到DonDestroyOnLoad。
73-
7468
- Example 场景
7569

7670
作用:WebSocket的使用方法示例。

README_EN.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
```csharp
2424
// the namespace
2525
using UnityWebSocket;
26-
using UnityWebSocket.Synchronized;
2726

2827
// create instance
2928
WebSocket scoket = new WebSocket();
@@ -46,15 +45,15 @@
4645
socket.CloseAsync();
4746
```
4847

49-
- more detail usage, see the [Example](UnityWebSocket/Assets/Scripts/Plugins/UnityWebSocket/Example/TestWebSocket.cs) code in project。
48+
- more detail usage, see the [Example.cs](UnityWebSocket/Assets/UnityWebSocket/Example/Example.cs) code in project。
5049

5150
#### 3. Attention(Warning)
5251

5352
- there are many **WebSocket** class in different namespace, use in different situations.
5453

5554
namespace | platform | sync style | description
5655
-|-|-|-
57-
UnityWebSocket.Synchronized | all | synchronized(no block) | **[recommend]** no need consider the problem by using unity component in asynchronized callback.
56+
UnityWebSocket | all | synchronized(no block) | **[recommend]** no need consider the problem by using unity component in asynchronized callback.
5857
UnityWebSocket.Uniform | all | asynchronized | consider the problem by using unity component in asynchronized callback.
5958
UnityWebSocket.WebGL | WebGL only | asynchronized | only run in WebGL platform.
6059
UnityWebSocket.NoWebGL | WebGL except | asynchronized | only run in not WebGL platforms.
@@ -63,16 +62,12 @@
6362

6463
- WebSocket.jslib, syntax follow to [asm.js](http://www.ruanyifeng.com/blog/2017/09/asmjs_emscripten.html)
6564

66-
Path: Plugins/WebSocketJS/WebSocketJS.jslib
65+
Path: Plugins/WebGL/WebSocket.jslib
6766
Fucntion:Unity will deploy it to web js runtime on WebGL platform.
6867

69-
- WebSocketReceiver.cs
70-
71-
Function: interact with jslib. this script set as DonDestroyOnLoad.
72-
7368
- Example Scene
7469

75-
Function: show how to use UnityWebSocket.
70+
Function: Example how to use UnityWebSocket.
7671

7772
#### 5. WebSocket Server
7873

UnityWebSocket/Assembly-CSharp-firstpass.csproj

Lines changed: 308 additions & 0 deletions
Large diffs are not rendered by default.

UnityWebSocket/Assembly-CSharp.csproj

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,8 @@
6363
</Reference>
6464
</ItemGroup>
6565
<ItemGroup>
66-
<Compile Include="Assets\Scripts\Plugins\UnityWebSocket\Core\CloseEventArgs.cs" />
67-
<Compile Include="Assets\Scripts\Plugins\UnityWebSocket\Core\CloseStatusCode.cs" />
68-
<Compile Include="Assets\Scripts\Plugins\UnityWebSocket\Core\ErrorEventArgs.cs" />
69-
<Compile Include="Assets\Scripts\Plugins\UnityWebSocket\Core\IWebSocket.cs" />
70-
<Compile Include="Assets\Scripts\Plugins\UnityWebSocket\Core\MessageEventArgs.cs" />
71-
<Compile Include="Assets\Scripts\Plugins\UnityWebSocket\Core\Opcode.cs" />
72-
<Compile Include="Assets\Scripts\Plugins\UnityWebSocket\Core\OpenEventArgs.cs" />
73-
<Compile Include="Assets\Scripts\Plugins\UnityWebSocket\Core\WebSocketState.cs" />
7466
<Compile Include="Assets\Scripts\Plugins\UnityWebSocket\Example\TestWebSocket.cs" />
75-
<Compile Include="Assets\Scripts\Plugins\UnityWebSocket\Implementation\NoWebGL\WebSocket.cs" />
76-
<Compile Include="Assets\Scripts\Plugins\UnityWebSocket\Implementation\Synchronized\UnityWebSocketDebuger.cs" />
77-
<Compile Include="Assets\Scripts\Plugins\UnityWebSocket\Implementation\Synchronized\UnityWebSocketManager.cs" />
78-
<Compile Include="Assets\Scripts\Plugins\UnityWebSocket\Implementation\Synchronized\WebSocket.cs" />
79-
<Compile Include="Assets\Scripts\Plugins\UnityWebSocket\Implementation\Uniform\WebSocket.cs" />
80-
<Compile Include="Assets\Scripts\Plugins\UnityWebSocket\Implementation\WebGL\WebSocket.cs" />
81-
<Compile Include="Assets\Scripts\Plugins\UnityWebSocket\Implementation\WebGL\WebSocketReceiver.cs" />
67+
<None Include="Assets\Scripts\Plugins\UnityWebSocket\Example\UnityWebSocket.Example.asmdef" />
8268
<Reference Include="Unity.PackageManagerUI.Editor">
8369
<HintPath>/Users/yinlong/Documents/github/UnityWebSocket/UnityWebSocket/Library/ScriptAssemblies/Unity.PackageManagerUI.Editor.dll</HintPath>
8470
</Reference>
@@ -629,6 +615,16 @@
629615
<HintPath>/Applications/Unity/2018.4.21f1/Unity.app/Contents/NetStandard/compat/2.0.0/shims/netfx/mscorlib.dll</HintPath>
630616
</Reference>
631617
</ItemGroup>
618+
<ItemGroup>
619+
<ProjectReference Include="UnityWebSocket.Runtime.csproj">
620+
<Project>{1600FD27-F8F3-E01A-5597-A3E922150CA4}</Project>
621+
<Name>UnityWebSocket.Runtime</Name>
622+
</ProjectReference>
623+
<ProjectReference Include="UnityWebSocket.Editor.csproj">
624+
<Project>{A5A4144C-6723-BE5C-957D-698FD90C4513}</Project>
625+
<Name>UnityWebSocket.Editor</Name>
626+
</ProjectReference>
627+
</ItemGroup>
632628
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
633629
<Target Name="GenerateTargetFrameworkMonikerAttribute" />
634630
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

UnityWebSocket/Assets/Plugins/WebSocketJS/WebSocketJS.jslib

Lines changed: 0 additions & 167 deletions
This file was deleted.

UnityWebSocket/Assets/Plugins/WebSocketJS/WebSocketJS.jslib.meta

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)