Legacy Documentation: Version 5.2
WebGL
Getting Started with WebGL Development

WebGL Preview Player Settings

This page details the Player Settings specific to the WebGL Preview. A description of the general Player Settings can be found here.

Other Settings

Property: Function:
Rendering
Rendering Path
Auto Graphics API
Static Batching Should static batching be enabled?
Dynamic Batching Should dynamic batching be enabled?
Configuration
Scripting Backend
Disable HW Statistics
Scripting Define Symbols Custom compilation flags (see the platform dependent compilation page for details).
Optimization
Api Compatibility Level Specifies active .NET API profile. See below.
        .Net 2.0 .Net 2.0 libraries. Maximum .net compatibility, biggest file sizes
        .Net 2.0 Subset Subset of full .net compatibility, smaller file sizes
Prebake Collision Meshes Enable collision mesh baking during the build.
Preload Shaders Enable shader preloading.
Preload Assets Enable asset preloading. Specify the size of assets to preload.
Strip Engine Code Enable code stripping for WebGL.
Vertex Compression
Optimize Mesh Data Remove any data from meshes that is not required by the material applied to them (tangents, normals, colors, UV).

API Compatibility Level

You can choose your mono api compatibility level for all targets except the webplayer. Sometimes a 3rd party .net dll will use things that are outside of the .net compatibility level that you would like to use. In order to understand what is going on in such cases, and how to best fix it, get “Reflector” on windows.

  1. Drag the .net assemblies for the api compatilibity level in question into reflector. You can find these in Frameworks/Mono/lib/mono/YOURSUBSET/
  2. Also drag in your 3rd party assembly.
  3. Right click your 3rd party assembly, and select “Analyze”.
  4. In the analysis report, inspect the “Depends on” section. Anything that the 3rd party assembly depends on, but is not available in the .net compatibility level of your choice will be highlighted in red there.

Publishing Settings

Property: Function:
WebGL Memory Size Sets the memory available to the WebGL runtime, given in megabytes. You should choose this value carefully: if it is too low, you will get out-of-memory errors because your loaded content and scenes won’t fit into the available memory. However, if you request too much memory then some browser/platform combinations might not be able to provide it and consequently fail to load the player.
Enable Exceptions Enable exception support
Data caching

Further information about WebGL Publishing Settings can be found in the WebGL Building and Running page.

WebGL
Getting Started with WebGL Development
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961