mugon.net docs
SDKs

Unity (coming soon)

Unity WebGL builds. Coming soon, not validated yet.

Coming soon: Unity support is not available yet. This page keeps the intended integration for reference; it is not validated, so expect rough edges.

Intended shape

Use a custom WebGL template whose index.html loads mugon.iife.js as the first script, then creates the Unity instance from inside Mugon.start and forwards Unity's progress callback:

Mugon.start(async (ctx) => {
  await createUnityInstance(document.querySelector("#canvas"), config, (progress) =>
    ctx.progress.set(progress, "Loading Unity"),
  );
  ctx.progress.done();
});

Things to check

  • How Unity loads its data. The file proxy caches fetch() calls only. If your Unity version loads .data/.wasm with XMLHttpRequest or through <script> elements, they still load, but aren't cached yet.
  • Persistent data. Unity's IDBFS-backed Application.persistentDataPath doesn't work in a mugon game, see saving data.

On this page