Skip to content

Commit

Permalink
update demo
Browse files Browse the repository at this point in the history
elringus committed Dec 10, 2024
1 parent 71a5a3f commit f004efc
Showing 16 changed files with 18 additions and 643 deletions.
Binary file removed docs/demo/Build/demo.data.unityweb
Binary file not shown.
Binary file removed docs/demo/Build/demo.framework.js.unityweb
Binary file not shown.
1 change: 0 additions & 1 deletion docs/demo/Build/demo.loader.js

This file was deleted.

Binary file removed docs/demo/Build/demo.wasm.unityweb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed docs/demo/StreamingAssets/Characters/Ball/Disco.webm
Binary file not shown.
Binary file removed docs/demo/StreamingAssets/Characters/Ball/Sun.webm
Binary file not shown.
448 changes: 0 additions & 448 deletions docs/demo/StreamingAssets/aa/AddressablesLink/link.xml

This file was deleted.

1 change: 0 additions & 1 deletion docs/demo/StreamingAssets/aa/catalog.json

This file was deleted.

1 change: 0 additions & 1 deletion docs/demo/StreamingAssets/aa/settings.json

This file was deleted.

Binary file removed docs/demo/favicon.ico
Binary file not shown.
168 changes: 0 additions & 168 deletions docs/demo/index.html

This file was deleted.

Binary file removed docs/demo/loader.webp
Binary file not shown.
42 changes: 18 additions & 24 deletions docs/public/demo/index.html
Original file line number Diff line number Diff line change
@@ -22,10 +22,6 @@
position: fixed;
}

#loading-content {
display: none;
}

#loading-box {
width: 100%;
height: 0;
@@ -133,40 +129,38 @@
<div id="progress-bar"></div>
</div>
<div id="icon"></div>
<p id="loading-info"></p>
<p id="loading-info">LOADING...</p>
</div>
<script src="Build/demo.loader.js"></script>
<script>
/* @formatter:off */
createUnityInstance(document.querySelector("#unity-canvas"), {
dataUrl: "Build/demo.data.unityweb",
frameworkUrl: "Build/demo.framework.js.unityweb",
codeUrl: "Build/demo.wasm.unityweb",
streamingAssetsUrl: "StreamingAssets",
companyName: "Elringus",
productName: "Naninovel Samples",
productVersion: "1.20"
}, handleProgress);
/* @formatter:on */
window.addEventListener("load", () => {
/* @formatter:off */
createUnityInstance(document.querySelector("#unity-canvas"), {
dataUrl: "Build/demo.data.unityweb",
frameworkUrl: "Build/demo.framework.js.unityweb",
codeUrl: "Build/demo.wasm.unityweb",
streamingAssetsUrl: "StreamingAssets",
companyName: "Elringus",
productName: "Naninovel Samples",
productVersion: "1.20"
}, handleProgress);
/* @formatter:on */
});

function handleProgress(progress) {
if (progress === 1) {
document.getElementById("loading-box").style.display = "none";
document.getElementById("icon").style.display = "none";
document.getElementById("loading-info").style.display = "none";
document.getElementById("box").style.display = "none";
document.getElementById("loading-content").style.display = "none";
} else if (progress >= .9) {
document.getElementById("loading-info").innerHTML = "INITIALIZING...";
document.getElementById("spinner").style.display = "inherit";
document.getElementById("bg-bar").style.display = "none";
document.getElementById("progress-bar").style.display = "none";
} else if (progress > 0) {
document.getElementById("loading-content").style.display = "inherit";
document.getElementById("progress-bar").style.width = 300 * progress + "px";
document.getElementById("loading-info").innerHTML = Math.round(progress * 100) + "%";
document.getElementById("spinner").style.display = "none";
document.getElementById("bg-bar").style.display = "block";
document.getElementById("spinner").style.display = "none";
document.getElementById("progress-bar").style.display = "inherit";
document.getElementById("progress-bar").style.width = 300 * progress + "px";
document.getElementById("loading-info").innerHTML = Math.round(progress * 100) + "%";
}
}
</script>

0 comments on commit f004efc

Please sign in to comment.