sno / unity-webgl-responsive

Responsive layout for Unity WebGL applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unity container not instantiating on mobile devices

sno opened this issue · comments

script in index.html dictates that the unity container only loads when a non-mobile user agent is detected:

    <script>
      // instantiate webgl only if we're not on a touch device

      var isTouch = ('ontouchstart' in document.documentElement);

      if ( !isTouch ) {
        var unityInstance = UnityLoader.instantiate("unityContainer", "Build/example.json");
      }
    </script>

this shouldn't be the default, or at least come with an easy setting.

fixed in commit 4e49abc