Switch to the WebGL platform
To build a WebGL project you need to switch platforms:
- Open File > Build Settings…
- Select WebGL and click Switch Platform.
- Click Player Settings…
- Go to Player > WebGL tab > Resolution and Presentation.
- Choose a template, based on your Unity version.
Add SDK support to custom template
If you want to build your WebGL project using a custom template to be compatible with the SDK features, you need to add the mirage-web3.js
JavaScript library to it:
- Load latest release of our WebGL library (lib.zip).
- Unpack it.
- Copy mirage-web3.js to directory with JavaScript sources.
- Import the script to your template page somewhere before the closing
body
tag:
<body>
...
<script src="your-js-dir/mirage-web3.js"></script>
</ body>