1.在同一场景中使用两个Canvas:
CanvasA:Render Mode->Screen Space - Overlay
CanvasB:Render Mode->Screen Space - Camera
CanvasA会遮挡CanvasB的UI上的交互事件
解决方案:将CanvasA置于一个父Canvas下,设置其父Canvas的Render Mode->Screen Space - Overlay
2.UI 效果组件
阴影 (Shadow)
阴影组件为图形组件(如文本或图像)添加简单的轮廓效果。必须与图形组件位于同一游戏对象上。
无效果的文本。 有阴影效果的文本。
轮廓 (Outline)
轮廓组件为图形组件(如文本或图像)添加简单的轮廓效果。必须与图形组件位于同一游戏对象上。
UV1 位置 (Position as UV1)
此组件为文本和图像图形添加简单的 UV1 位置效果。
3.通过对委托/事件的注册的方法进行调整,以减少Update类方法中对枚举类的检查
2021/10/29
4.Dropdown.options.Add(new Dropdown.OptionData(“A”));
添加后,在下拉列表中出现了新添加的项,但在选择时,并未能将该项显示在CaptureText中,需要调用以下方法以刷新显示:
Dropdown.RefreshShowValue();
5.Unity WebGL 2020以上版本
Enable Exceptions 设置为None时,会报错!!!
打包时需要放置以下配置文件
web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".unity3d" mimeType="application/binary" />
<mimeMap fileExtension=".unityweb" mimeType="application/binary" />
</staticContent>
<directoryBrowse enabled="true" />
</system.webServer>
</configuration>
7.相机的Clipping Planes : Near 设置的过小,可能会使得发布后画面出现闪烁的问题
8.WebGL
Unable to parse Build/WebGL_01.framework.js.gz! This can happen if build compression was enabled but web server hosting the content was misconfigured to not serve the file with HTTP Response Header “Content-Encoding: gzip” present. Check browser Console and Devtools Network tab to debug.
勾选Decompression Fallback