浏览代码

Merge pull request #182 from UnityTech/yczhang

WebGL plugin compatibility with 2019.
/main
GitHub 5 年前
当前提交
e993e68b
共有 7 个文件被更改,包括 1227 次插入41 次删除
  1. 5
      README-ZH.md
  2. 5
      README.md
  3. 110
      Runtime/Plugins/platform/webgl/UIWidgetsCanvasDevicePixelRatio_2018.3.jslib.meta
  4. 1001
      Runtime/Plugins/platform/webgl/UIWidgetsCanvasDevicePixelRatio_2019.1.jslib
  5. 110
      Runtime/Plugins/platform/webgl/UIWidgetsCanvasDevicePixelRatio_2019.1.jslib.meta
  6. 37
      Runtime/Plugins/platform/webgl/UIWidgetsCanvasDevicePixelRatio.jslib.meta
  7. 0
      /Runtime/Plugins/platform/webgl/UIWidgetsCanvasDevicePixelRatio_2018.3.jslib

5
README-ZH.md


#### 八、WebGL Canvas分辨率调整插件
因为浏览器中Canvas的宽高和其在显示器上的像素数可能不一致,所以构建出的WebGL程序中画面可能会模糊。
插件`Plugins/platform/webgl/UIWidgetsCanvasDevicePixelRatio.jslib`解决了这个问题。
如果您因为任何原因需要禁止此插件,请在Project面板中选中该插件,在Inspector面板中的Define Constraints参数中,输入任意(没有被Unity定义为宏)的字符串(例如`ENABLE_CANVAS_DEVICE_PIXEL_RATIO_PLUGIN`),使得只有在Player Settings中定义了这个宏,此插件才会启用。
插件`Plugins/platform/webgl/UIWidgetsCanvasDevicePixelRatio_20xx.x.jslib`(目前有2018.3和2019.1)解决了这个问题。
请根据您的项目的Unity版本选择对应的插件,并禁用此插件的其他版本。方法如下:在Project面板中选中该插件,在Inspector面板中的Select platforms for plugin中,去掉WebGL后面的对勾。
如果您因为任何原因需要完全禁止此插件的功能,请按上述方法禁用此插件的所有版本。
此插件覆盖了Unity WebGL构建模块中的如下参数:
```

5
README.md


#### WebGL Canvas Device Pixel Ratio Plugin
The width and height of the Canvas in browser may differ from the number of pixels the Canvas occupies on the screen.
Therefore, the image may blur in the builded WebGL program.
The Plugin `Plugins/platform/webgl/UIWidgetsCanvasDevicePixelRatio.jslib` solves this issue.
If you need to disable this plugin for any reason, please select this plugin in the **Project** panel, and put an arbitrary string (that is not defined as a macro by Unity) in the **Define Constraints** field in the **Inspector** panel (for example, `ENABLE_CANVAS_DEVICE_PIXEL_RATIO_PLUGIN`), so that the plugin is enabled only if this macro is defined in **Player Settings**, which effectively disables the plugin.
The Plugin `Plugins/platform/webgl/UIWidgetsCanvasDevicePixelRatio_20xx.x.jslib` (2018.3 and 2019.1 for now) solves this issue.
Please select the plugin of the Unity version corresponding to your project, and disable other versions of this plugin, as follows: select this plugin in the **Project** panel, and uncheck **WebGL** under **Select platforms for plugin** in the **Inspector** panel.
If you need to disable this plugin for any reason, please disable all the versions of this plugin as described above.
This plugin overrides the following parameters in the Unity WebGL building module:
```

110
Runtime/Plugins/platform/webgl/UIWidgetsCanvasDevicePixelRatio_2018.3.jslib.meta


fileFormatVersion: 2
guid: eed39ef42fc8d4856874e03a2ae9c63a
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 1
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXUniversal: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
Exclude iOS: 1
- first:
Android: Android
second:
enabled: 0
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: WebGL
second:
enabled: 1
settings: {}
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: x86_64
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
WebGL: WebGL
second:
enabled: 0
settings: {}
- first:
iPhone: iOS
second:
enabled: 0
settings:
AddToEmbeddedBinaries: false
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

1001
Runtime/Plugins/platform/webgl/UIWidgetsCanvasDevicePixelRatio_2019.1.jslib
文件差异内容过多而无法显示
查看文件

110
Runtime/Plugins/platform/webgl/UIWidgetsCanvasDevicePixelRatio_2019.1.jslib.meta


fileFormatVersion: 2
guid: fa7d598e002d745e487155c443ed56e4
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 1
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXUniversal: 1
Exclude WebGL: 0
Exclude Win: 1
Exclude Win64: 1
Exclude iOS: 1
- first:
Android: Android
second:
enabled: 0
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: WebGL
second:
enabled: 1
settings: {}
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: x86_64
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
WebGL: WebGL
second:
enabled: 1
settings: {}
- first:
iPhone: iOS
second:
enabled: 0
settings:
AddToEmbeddedBinaries: false
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

37
Runtime/Plugins/platform/webgl/UIWidgetsCanvasDevicePixelRatio.jslib.meta


fileFormatVersion: 2
guid: 9e688991bb495461b8404d9fb47c6684
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Facebook: WebGL
second:
enabled: 1
settings: {}
- first:
WebGL: WebGL
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:

/Runtime/Plugins/platform/webgl/UIWidgetsCanvasDevicePixelRatio.jslib → /Runtime/Plugins/platform/webgl/UIWidgetsCanvasDevicePixelRatio_2018.3.jslib

正在加载...
取消
保存