![]() With this option checked, Unity does not include code for any classes you don’t use. This option is checked by default to enable code stripping for WebGL. Open Other Settings to access the Strip Engine Code option. WebGL has some additional options in the PlayerSettings Inspector window (menu: Edit > Project Settings > Player). This is because the Profiler connection is handled using WebSockets on WebGL, but a web browser only allows outgoing connections from the content. For WebGL, it is not possible to connect the Profiler to a running build as on other platforms, so you have to use this option to connect the content to the Editor. Check the Autoconnect Profiler option to profile your Unity WebGL content. This option can only be enabled when you have the Development Build checkbox checked. Due to the dynamic linking overhead, the performance of this type of build is slower than a normal build. Note that this type of build is only suited for development purposes, as it always produces unstripped engine code. When this option is enabled, Unity rebuilds only the managed code and then links dynamically with the pre-build Unity engine, so the project is rebuilt approximately 30–40% faster. Use the Use pre-built Engine option in the Build Settings dialog box to speed up build iteration time during development. This option only appears when you have the Development Build checkbox checked. Note, however, that this means development builds are very large, and too large to distribute. In addition, development builds do not compress content (that is, content is not minified) they maintain JavaScript in human-readable form, preserving function names so you get useful stack traces for errors. When you check the Development Build checkbox, Unity generates a development build which has Profiler support and a development console to see errors. In the dialog box, select WebGL from the Platform list, then select Player Settings…. Build player optionsĪccess the WebGL options via the in the Build Settings dialog box. unityweb files accessible, because the server needs to provide these files to clients. On some servers you need to explicitly make. This is required on a PC to allow execution of the build. Alternatively, you can run Chrome with the -allow-file-access-from-files command line option which allows it to load content from local file URLs. To work round Chrome’s restrictions, use Unity’s Build & Run command ( File > Build & Run) the file is then temporarily hosted in a local web server and opened from a local host URL. However, for security reasons, Chrome places restrictions on scripts opened from local file URLs, so this technique does not work in Chrome. You can view your WebGL player directly in most browsers by opening the index.html file. See documentation on deploying compressed builds for more information The contents of the *.unityweb files in the Build folder may be compressed with gzip, brotli or may be uncompressed, depending on the Publishing Settings. JSON may contain additional Module parameters, such as the splash screen style or the initial size of the memory heap.Ī file containing the asm.js runtime and JavaScript plugins.Ī file containing the asm.js module for your player.Ī file containing a binary image to initialize the heap memory for your player.Ī file containing the Asset data and Scenes. JSON file contains URLs of all the other build files, which can be absolute or relative to the location of the JSON file. The URL of this JSON file is provided as an argument for the Unity Loader when the build is instantiated. ![]() The Build folder contains the following files (the MyProject file name represents the name of your project).Ī UnityLoader.js JavaScript file containing the code needed to load up the Unity content in the web page.Ī MyProject.json JSON file containing all the necessary information about your build. See the User Manual page on WebGL templates for more information.Ī Build folder containing your generated build output files. The build template folder is normally used to customize the appearance of the build while loading. ![]() When you build a WebGL project, Unity creates a folder with the following files:Īn index.html file which browsers can navigate to load your content.Ī TemplateData folder (when building with the default template) containing the build logo, loading bar and other template Assets.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |