|
1 | 1 | # unity-webgl
|
2 | 2 |
|
3 | 3 | [](https://www.npmjs.com/package/unity-webgl)
|
| 4 | +[](https://codecov.io/gh/Marinerer/unity-webgl) |
| 5 | +[](https://github.com/Marinerer/unity-webgl/releases) |
4 | 6 | [](https://www.npmjs.com/package/unity-webgl)
|
5 | 7 | [](https://bundlephobia.com/package/unity-webgl)
|
6 | 8 | [](https://github.com/Marinerer/unity-webgl)
|
|
9 | 11 |
|
10 | 12 | `unity-webgl` 提供了一个简单的解决方案,用于将 `Unity WebGL` 构建嵌入到 Web 应用程序中,同时为 Unity 和 WebApp 应用之间的双向通信和交互提供 API。
|
11 | 13 |
|
12 |
| -> 无框架限制,可用于任何 Web 项目。 |
13 |
| -> 目前仅内置vue组件,支持 `vue2/3`。 |
| 14 | +> 🚨 提醒 |
| 15 | +> |
| 16 | +> `v4.x` 版本进行了较大更新,API 不兼容 `v3.x`及之前版本。升级请参考 [变更信息](https://github.com/Marinerer/unity-webgl/wiki/Major-changes-in-v4) |
| 17 | +
|
14 | 18 |
|
15 | 19 | Based on [react-unity-webgl](https://github.com/jeffreylanters/react-unity-webgl)
|
16 | 20 |
|
17 | 21 | ## Features
|
18 | 22 |
|
19 |
| -📦 集成简单,无框架限制 |
20 |
| -📩 支持 `WebApp` 与 `Unity` 双向通信和交互 |
21 |
| -⏰ 全面的事件处理机制 |
22 |
| -🧲 内置 `vue` 组件 (vue2/3) |
| 23 | +- 📦 集成简单,无框架限制 |
| 24 | +- 📩 支持 `WebApp` 与 `Unity` 双向通信和交互 |
| 25 | +- ⏰ 全面的事件处理机制 |
| 26 | +- 🧲 内置 `vue` 组件 (`vue2/3`) |
23 | 27 |
|
24 | 28 | ## Installation
|
25 | 29 |
|
@@ -118,10 +122,10 @@ unityContext.create(canvas: HTMLCanvasElement | string)
|
118 | 122 |
|
119 | 123 | | Property | Type | Description | Required |
|
120 | 124 | | ------------------------ | ------- | ------------------------------------------------------------------------------------- | -------- |
|
121 |
| -| `loaderUrl` | string | Unity 资源加载器文件 | ✅ | |
122 |
| -| `dataUrl` | string | 包含资源数据和场景的文件 | ✅ | |
123 |
| -| `frameworkUrl` | string | 包含运行时和插件代码的文件 | ✅ | |
124 |
| -| `codeUrl` | string | 包含原生代码的 WebAssembly 二进制文件 | ✅ | |
| 125 | +| `loaderUrl` | string | Unity 资源加载器文件 | ✅ | |
| 126 | +| `dataUrl` | string | 包含资源数据和场景的文件 | ✅ | |
| 127 | +| `frameworkUrl` | string | 包含运行时和插件代码的文件 | ✅ | |
| 128 | +| `codeUrl` | string | 包含原生代码的 WebAssembly 二进制文件 | ✅ | |
125 | 129 | | `streamingAssetsUrl` | string | 流媒体资源的 URL | 可选 |
|
126 | 130 | | `memoryUrl` | string | 生成的框架文件的 URL | 可选 |
|
127 | 131 | | `symbolsUrl` | string | 生成的 Unity 代码文件的 URL | 可选 |
|
@@ -329,6 +333,8 @@ public class WebGLPluginJS : MonoBehaviour
|
329 | 333 | - [调试 WebGL 构建并排除故障](https://docs.unity3d.com/cn/2023.2/Manual/webgl-debugging.html)
|
330 | 334 | - [WebGL 性能考虑因素](https://docs.unity3d.com/cn/2023.2/Manual/webgl-performance.html)
|
331 | 335 |
|
| 336 | + |
| 337 | + |
332 | 338 | ## License
|
333 | 339 |
|
334 | 340 | MIT License
|
|
0 commit comments