Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
U

unity-webgl-responsive

> 编程语言
Open source

Responsive layout for Unity WebGL applications

197 stars0 likes3 views
WebsiteGitHub

About

Responsive layout for Unity WebGL applications

This repo is no longer maintained.

Between the many different Unity versions and their varying template setups as well as my lack of resources, I haven't been able to maintain this repository. If you're interested it co-maintaining or taking over, please let me know.

unity-webgl-responsive

Responsive layout template for Unity WebGL applications, intended for websites that have more going on than the application itself.

Demo

How to use

Create a folder called WebGLTemplates in the Assets folder of your Unity project.

For Unity 2018 and 2019, copy the responsive-template folder and all of its contents into WebGLTemplates.

For Unity 2020.1 and newer, copy the responsive-template-2020 folder instead, as changes to the WebGL loader and templates were introduced with 2020.1.

Select the template in the Player settings (Edit > Project Settings then select the Player category) and set the default canvas resolution.

Optionally, change the properties of .webgl-wrapper in style.css to set the application's maximum width:

.webgl-wrapper {
  width: 100%;
  max-width: 1280px; /* remove this line for full width */
}

For Gzip-compressed builds (see Publishing Settings), you should turn on Decompression Fallback or configure your web server to add Content-Encoding: gzip response header.

Notes

  • Press F to toggle fullscreen. Customize this behavior in the script at the bottom of index.html.
  • The application canvas preserves the aspect ratio set in the Player settings in Project Settings.

Resulting HTML includes credits and a link back to this page, which is appreciated, but feel free to remove all of that and modify the template as needed. Disney head in the example project courtesy of David OReilly.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言