浏览代码

Update WebGL README.

/main
Yuncong Zhang 6 年前
当前提交
3cfbd274
共有 2 个文件被更改,包括 34 次插入4 次删除
  1. 19
      README-ZH.md
  2. 19
      README.md

19
README-ZH.md


默认的逻辑是在界面静止时将帧率降低为15,在界面变动时将帧率提高至60。
如果您需要修改帧率升高或降低时的行为,请将`Window.onFrameRateSpeedUp`和/或`Window.onFrameRateCoolDown`设置为您自己的函数。
#### 八、WebGL分辨率调整插件
#### 八、WebGL Canvas分辨率调整插件
如果您因为任何原因需要禁止此插件,请在Project面板中选中该插件,在Inspector面板中的Define Constraints参数中,填入一个未被定义的宏名称。
如果您因为任何原因需要禁止此插件,请在Project面板中选中该插件,在Inspector面板中的Define Constraints参数中,输入`ENABLE\_CANVAS\_DEVICE\_PIXEL\_RATIO\_PLUGIN`。
此插件覆盖了Unity WebGL构建模块中的如下参数:
```
JS_SystemInfo_GetWidth
JS_SystemInfo_GetHeight
JS_SystemInfo_GetCurrentCanvasWidth
JS_SystemInfo_GetCurrentCanvasHeight
$Browser
$JSEvents
```
如果您需要实现自己的WebGL插件,并且您的插件覆盖了这些参数中的至少一种,您需要采用上文中提到的方法禁用`UIWidgetsCanvasDevicePixelRatio`插件,以防止可能的冲突。
如果您仍然需要此插件所提供的功能,您可以手动将此插件对Unity WebGL构建模块的修改应用到您的插件中。
`UIWidgetsCanvasDevicePixelRatio`插件中所有的修改之处都以`////////// Modification Start ////////////`和`////////// Modification End ////////////`标识。
在被标识的代码中,所有乘/除以`devicePixelRatio`都来自于我们的修改。
若您需要详细了解此插件所修改的脚本,请参考您的Unity Editor安装目录下的`PlaybackEngines/WebGLSupport/BuildTools/lib`文件夹中的`SystemInfo.js`和`UnityNativeJS/UnityNative.js`。
## 调试UIWidgets应用程序

19
README.md


The default logic is to set the frame rate to 15 when the screen is static, and change the frame rate to 60 whenever the screen changes.
If you would like to modify the behavior of speeding up or cooling down the frame rate, please set `Window.onFrameRateSpeedUp` and/or `Window.onFrameRateCoolDown` to your own functions.
#### WebGL Device Pixel Ratio Plugin
#### WebGL Canvas Device Pixel Ratio Plugin
If you need to disable this plugin for any reason, please select this plugin in the **Project** panel, and put an arbitrary undefined macro name in the **Define Constraints** field in the **Inspector** panel.
If you need to disable this plugin for any reason, please select this plugin in the **Project** panel, and put `ENABLE\_CANVAS\_DEVICE\_PIXEL\_RATIO\_PLUGIN` in the **Define Constraints** field in the **Inspector** panel.
This plugin overrides the following parameters in the Unity WebGL building model:
```
JS_SystemInfo_GetWidth
JS_SystemInfo_GetHeight
JS_SystemInfo_GetCurrentCanvasWidth
JS_SystemInfo_GetCurrentCanvasHeight
$Browser
$JSEvents
```
If you would like to implement your own WebGL plugin, and your plugin overrides at least one of the above parameters, you need to disable the UIWidgetsCanvasDevicePixelRatio` plugin in the above mentioned way to avoid possible conflicts.
If you still need the function provided by this plugin, you can mannually apply the modification to Unity WebGL building module introduced in this plugin.
All the modifications introduced in `UIWidgetsCanvasDevicePixelRatio` are marked by `////////// Modifcation Start ////////////` and `////////// Modifcation End ////////////`.
In the marked codes, all the multiplications and divisions with `devicePixelRatio` are introduced by our modification.
To learn about the original script in detail, please refer to `SystemInfo.js` and `UnityNativeJS/UnityNative.js` in `PlaybackEngines/WebGLSupport/BuildTools/lib` in your Unity Editor installation.
## Debug UIWidgets Application

正在加载...
取消
保存