diff --git a/WebGLTemplates/BetterMinimal/index.html b/WebGLTemplates/BetterMinimal/index.html index 7807807..9d3745b 100644 --- a/WebGLTemplates/BetterMinimal/index.html +++ b/WebGLTemplates/BetterMinimal/index.html @@ -1,5 +1,6 @@ + @@ -10,10 +11,11 @@ var scaleToFit; try { scaleToFit = !!JSON.parse("%UNITY_CUSTOM_SCALE_TO_FIT%"); - } catch(e) { + } catch (e) { scaleToFit = true; } - window.onresize = function() { + + function onResize() { var canvas = gameInstance.Module.canvas; var container = gameInstance.container; var w; @@ -39,6 +41,7 @@ container.style.top = Math.floor((window.innerHeight - h) / 2) + "px"; container.style.left = Math.floor((window.innerWidth - w) / 2) + "px"; } + window.addEventListener('resize', onResize); - +
+