Skip to content
A better default template for Unity WebGL
Branch: master
Clone or download
Latest commit 55e3752 Oct 1, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Assets fix logo css Oct 1, 2018
ProjectSettings add new unity files Oct 1, 2018
.gitignore ignore .zip Nov 14, 2017
LICENSE.md Add a license May 10, 2018
README.md update readme Oct 1, 2018
WebGLFitWindow.sln initial commit Nov 14, 2017

README.md

A Better Unity WebGL template

I have no idea why Unity choose to not make its WebGL exporter default to filling the window like pretty much all other WebGL apps on the net but in any case here is a template

screenshot

Example: https://greggman.github.io/better-unity-webgl-template/

Instructions

Downloand and add in this unity package into your project. Then pick Edit->Project Settings->Player, in the WebGL tab under Resolution and Presentation pick "BetterTemplate".

Change Assets/WebGLTemplates/BetterTemplate/logo.png to whatever you want.

See Unity docs on how to customize WebGL Templates.

Changelist

  • 0.0.3

    • Try to make mobile dialog appear above logo.

      It's a little sad that Unity hard coded this rather than make it some kind of event and/or make the template itself handle this. The issue is there's no easy way to know if the inserted elements are the mobile warning or something else.

      I suppose could check if the game has actually loaded. If no it's the mobile warning. If yes then disable the CSS. Oh well, burn that bridge when we get there.

    • Fix logo size css

    • Add viewport tag

You can’t perform that action at this time.