webgl 整数 或者浮点数越界问题
float unrepresentable in integer range,RuntimeError: float unrepresentable in integer range
webgl解决方案:
https://emscripten.org/docs/compiling/WebAssembly.html#trap-mode
webGLEmscriptenArgs: -s “BINARYEN_TRAP_MODE=‘clamp’”
在unity 中解决方案:
参考:
https://forum.unity.com/threads/how-to-debug-webgl-builds.615094/
编译之前运行一下这个代码:
[MenuItem(“Custom/CompilationWebGL”)]
static public void AddWebGL()
{
PlayerSettings.WebGL.emscriptenArgs = “-s “BINARYEN_TRAP_MODE=‘clamp’””;
}