Build a Unity project for the SUD platform
Use the SUD Unity plugin to export the Unity project to a directory suitable for the SUD platform. Select this directory in PinK after exporting and generate the releaseable .sp package.
Install and open Unity plugins
Download plugin: sud-unity-plugin-v1.0.0.3.unitypackage
- Open the Unity project, select Assets > Import Package > Custom Package... . You can also drag
.unitypackagefiles directly into the editor. - Select the downloaded
.unitypackagefile and select " Import " in the import window. - Confirms that the
Assetsdirectory contains asud-unity-pluginfolder. - Select the SUD Mini Game > Convert Mini Game to open the plugin window.
Configure Build
Export Path
Select Selection to set the export directory of the build product. When the build is completed, the file will be written to the directory.
Basic Configuration
| Configure Item | Annotations |
|---|---|
| Development Build | Check to export the Debug version to facilitate debugging; without ticking, export a smaller Release version. |
| Color Space | Sets the colour space and usually maintains the default value for the item. |
| Texture Compression | Select texture compression formats by target platform, e.g. ETC2. |
| Exception Support | Sets the exception support level and usually maintains the default value. |
Plugin automatically fixes the following WebGL configuration without manual modification:
| Configure Item | Fixed value | Annotations |
|---|---|---|
| Compression Format | Disabled | Do not use Gzip or Brotli compression. |
| Data Caching | Disabled | Do not use the browser cache. |
Start Resource CDN
Check " Enable startup resource CDN " when reducing the main package size of the game. When open, the Unity .data resource will be loaded through the CDN.
Fill out the CDN root address in the Start Resource CDN Address, e. g.:
https://example.com/game/After export, upload the Build folder in the remote-assets directory to the CDN root address:
remote-assets/Build/Startup loading screen
After enabling the startup asset CDN, choose a loading-screen background. Use Select to add an image and Clear to remove it.
- Images fill the screen proportionally, with centered cropping.
- The width or height of the picture cannot exceed 2048 px.
- Local caches are used when resources are cached.
Scenes In Build
Expands Scenes In Build, selects the scene that you want to build. Keep at least one scene, otherwise it cannot be exported.
Start Export
- After the configuration, select Export.
- View build logs in Unity Console.
- Checks the automatically opened output directory after build is completed.
Attention.: The first WebGL build typically takes several to tens of minutes. Do not close Unity during build.
Check the output.
The output directory contains the following two folders:
| Contents | Use |
|---|---|
webgl/ | Unity original WebGL product, debugged via index.html. |
sud/ | For PinK to pack and publish the SUD little game catalogue. |
The sud directory usually contains the following documents:
sud/
├── main.js
├── unity_adapter.js
├── Build/
│ ├── *.loader.js
│ ├── *.framework.js
│ ├── *.data
│ └── *.wasm
└── StreamingAssets/Common problems
Export Failed
- View the error log in Unity Console.
- Confirms that the
Assets/sud-unity-plugindirectory exists and is complete. - Confirms that Scenes In Build has selected at least one scene.
- Select Manual Cache Cleanup to re-export.
Run abnormally after export
Confirms that sud/ contains main.js and unity_adapter.js and checks the completeness of loader.js, framework.js, data and wasm files in sud/Build/. You can also open the webgl/index.html first to check the problem of Unity WebGL build itself.
Build abnormal after switching Debug or Release
Select " Manually clear the cache " , and then re-export.
Import and package in PinK
Before selecting a directory, confirm that the directory exists, is writable and that the root level contains main.js.
The third-party engine project has already been compiled in Unity and adapted for SUD. PinK packages it without compiling it again.
Attention.: If main.js is in a subdirectories at a deeper level, select the subdirectories directly. When a directory check fails, PinK will prompt a new selection.
- Opens a directory of items exported from Unity in PinK.
- Open Project → Third-party Build.
- Configure the SUD platform parameters, and then select Build > Generate.
When successful, you can view the SUD platform.
PinK build troubleshooting
Not valid for prompt packing directory
Confirms that the directory exists, is writable and that the current level contains main.js. If the actual item is on the lower level, select the actual item directory instead of its parent directory.
appearing while uploading sp files 413
Commonly indicates that .sp files exceed the authorized upload size of the server. Recompile the tripartite engine project using Release and improve the level of compilation optimization and repackage.