Spaces:
Running
Running
Add Unity WebGL build files
Browse files- index.html +40 -83
index.html
CHANGED
|
@@ -1,92 +1,49 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en-us">
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
<
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
<div
|
| 22 |
</div>
|
|
|
|
| 23 |
</div>
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
const config = {
|
| 30 |
-
dataUrl: buildUrl + "/Retro-to-3D.data",
|
| 31 |
-
frameworkUrl: buildUrl + "/Retro-to-3D.framework.js",
|
| 32 |
-
codeUrl: buildUrl + "/Retro-to-3D.wasm",
|
| 33 |
-
streamingAssetsUrl: "StreamingAssets",
|
| 34 |
-
companyName: "ilumine AI",
|
| 35 |
-
productName: "Pj - 2D-to-3D",
|
| 36 |
-
productVersion: "0.1.12",
|
| 37 |
-
};
|
| 38 |
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
const canFullscreen = (function() {
|
| 48 |
-
for (const key of [
|
| 49 |
-
'exitFullscreen',
|
| 50 |
-
'webkitExitFullscreen',
|
| 51 |
-
'webkitCancelFullScreen',
|
| 52 |
-
'mozCancelFullScreen',
|
| 53 |
-
'msExitFullscreen',
|
| 54 |
-
]) {
|
| 55 |
-
if (key in document) {
|
| 56 |
-
return true;
|
| 57 |
}
|
|
|
|
|
|
|
|
|
|
| 58 |
}
|
| 59 |
-
|
| 60 |
-
|
|
|
|
| 61 |
|
| 62 |
-
|
| 63 |
-
container.className = "unity-mobile";
|
| 64 |
-
config.devicePixelRatio = 1;
|
| 65 |
-
}
|
| 66 |
-
loadingCover.style.display = "";
|
| 67 |
|
| 68 |
-
|
| 69 |
-
script.src = loaderUrl;
|
| 70 |
-
script.onload = () => {
|
| 71 |
-
createUnityInstance(canvas, config, (progress) => {
|
| 72 |
-
spinner.style.display = "none";
|
| 73 |
-
progressBarEmpty.style.display = "";
|
| 74 |
-
progressBarFull.style.width = `${100 * progress}%`;
|
| 75 |
-
}).then((unityInstance) => {
|
| 76 |
-
loadingCover.style.display = "none";
|
| 77 |
-
if (canFullscreen) {
|
| 78 |
-
if (!hideFullScreenButton) {
|
| 79 |
-
fullscreenButton.style.display = "";
|
| 80 |
-
}
|
| 81 |
-
fullscreenButton.onclick = () => {
|
| 82 |
-
unityInstance.SetFullscreen(1);
|
| 83 |
-
};
|
| 84 |
-
}
|
| 85 |
-
}).catch((message) => {
|
| 86 |
-
alert(message);
|
| 87 |
-
});
|
| 88 |
-
};
|
| 89 |
-
document.body.appendChild(script);
|
| 90 |
-
</script>
|
| 91 |
-
</body>
|
| 92 |
-
</html>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en-us">
|
| 3 |
+
|
| 4 |
+
<head>
|
| 5 |
+
<meta charset="utf-8">
|
| 6 |
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
| 7 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
| 8 |
+
<title>Pj - 2D-to-3D</title>
|
| 9 |
+
<link rel="shortcut icon" href="TemplateData/favicon.ico">
|
| 10 |
+
<link rel="stylesheet" href="TemplateData/style.css">
|
| 11 |
+
</head>
|
| 12 |
+
|
| 13 |
+
<body class="dark">
|
| 14 |
+
<div id="unity-container" class="unity-desktop">
|
| 15 |
+
<canvas id="unity-canvas"></canvas>
|
| 16 |
+
</div>
|
| 17 |
+
<div id="loading-cover" style="display:none;">
|
| 18 |
+
<div id="unity-loading-bar">
|
| 19 |
+
<div id="unity-logo"><img src="logo.png"></div>
|
| 20 |
+
<div id="unity-progress-bar-empty" style="display: none;">
|
| 21 |
+
<div id="unity-progress-bar-full"></div>
|
| 22 |
</div>
|
| 23 |
+
<div class="spinner"></div>
|
| 24 |
</div>
|
| 25 |
+
</div>
|
| 26 |
+
<div id="unity-fullscreen-button" style="display: none;"></div>
|
| 27 |
+
<script>
|
| 28 |
+
// ... (Tu código JavaScript existente está aquí) ...
|
| 29 |
+
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
+
<!-- Aquí es donde hemos insertado el nuevo script -->
|
| 32 |
+
<script type="text/javascript">
|
| 33 |
+
function readFromClipboard() {
|
| 34 |
+
navigator.clipboard.readText().then(
|
| 35 |
+
function (text) {
|
| 36 |
+
if (typeof UnityInstance !== 'undefined') {
|
| 37 |
+
UnityInstance.SendMessage('ClipboardManager', 'OnTextPasted', text);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
}
|
| 39 |
+
},
|
| 40 |
+
function (err) {
|
| 41 |
+
console.error('Error al leer del portapapeles: ', err);
|
| 42 |
}
|
| 43 |
+
);
|
| 44 |
+
}
|
| 45 |
+
</script>
|
| 46 |
|
| 47 |
+
</body>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
+
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|