Initial
This commit is contained in:
commit
36a53f343e
3 changed files with 300431 additions and 0 deletions
8
UnityProject/Assets/WebGLTemplates/FullScreenOnly.meta
Normal file
8
UnityProject/Assets/WebGLTemplates/FullScreenOnly.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3c27f7b8abdbfaf45a3a4922ff920a53
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
151
UnityProject/Assets/WebGLTemplates/FullScreenOnly/index.html
Normal file
151
UnityProject/Assets/WebGLTemplates/FullScreenOnly/index.html
Normal file
|
|
@ -0,0 +1,151 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="theme-color" content="#101010">
|
||||
<link href="https://fonts.googleapis.com/css?family=Roboto:100&subset=latin-ext" rel="stylesheet">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<title>Client</title>
|
||||
<script src="%UNITY_WEBGL_LOADER_URL%"></script>
|
||||
<script>
|
||||
|
||||
function goFS() {
|
||||
gameInstance.SetFullscreen(1);
|
||||
//document.getElementById("gameContainer").style["z-index"] = 100;
|
||||
}
|
||||
function onUnityLoaded() {
|
||||
document.getElementById("fullscreen").style.display = "block";
|
||||
document.getElementById("loading").style.display = "none";
|
||||
|
||||
}
|
||||
setInterval(function() {
|
||||
if (typeof TOTAL_MEMORY !== 'undefined') {
|
||||
try {
|
||||
var totalMem = TOTAL_MEMORY/1024.0/1024.0;
|
||||
var usedMem = (TOTAL_STACK + (STATICTOP - STATIC_BASE) +
|
||||
(DYNAMICTOP - DYNAMIC_BASE))/1024.0/1024.0;
|
||||
console.log('Memory stats - used: ' + Math.ceil(usedMem) + 'M' +
|
||||
' free: ' + Math.floor(totalMem - usedMem) + 'M');
|
||||
} catch(e) {}
|
||||
}
|
||||
}, 5000);
|
||||
|
||||
//no popup
|
||||
UnityLoader.compatibilityCheck = function(e, t, r) { t(); }
|
||||
|
||||
var gameInstance = UnityLoader.instantiate("gameContainer", "%UNITY_WEBGL_BUILD_URL%", {
|
||||
Module: {
|
||||
onRuntimeInitialized: onUnityLoaded
|
||||
}
|
||||
});
|
||||
|
||||
window.onresize = function(){
|
||||
var canvas = gameInstance.Module.canvas;
|
||||
var container = gameInstance.container;
|
||||
|
||||
var w = window.innerWidth;
|
||||
var h = window.innerHeight;
|
||||
var r = 9/16;
|
||||
if(w * r > window.innerHeight){
|
||||
w = Math.min(w, Math.ceil(h / r));
|
||||
}
|
||||
h = Math.floor(w * r);
|
||||
|
||||
container.style.width = canvas.style.width = w + "px";
|
||||
container.style.height = canvas.style.height = h + "px";
|
||||
container.style.top = Math.floor((window.innerHeight - h)/2) + "px";
|
||||
container.style.left = Math.floor((window.innerWidth - w)/2) + "px";
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
html,body{
|
||||
background: #000;
|
||||
background: ;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow:visible;
|
||||
padding:0;
|
||||
margin:0;
|
||||
}
|
||||
#gameContainer{
|
||||
background: transparent!important;
|
||||
position: absolute;
|
||||
z-index: -1;
|
||||
}
|
||||
#gameContainer canvas{
|
||||
position: absolute;
|
||||
image-rendering: optimizeSpeed;
|
||||
image-rendering: -webkit-crisp-edges;
|
||||
image-rendering: -moz-crisp-edges;
|
||||
image-rendering: -o-crisp-edges;
|
||||
image-rendering: crisp-edges;
|
||||
image-rendering: -webkit-optimize-contrast;
|
||||
image-rendering: optimize-contrast;
|
||||
image-rendering: pixelated;
|
||||
-ms-interpolation-mode: nearest-neighbor;
|
||||
}
|
||||
|
||||
#blocker {
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
|
||||
z-index: 0;
|
||||
display: flex;
|
||||
align-content: center;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #111;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-family: "Roboto", sans-serif;
|
||||
font-weight: 100;
|
||||
font-size: 4em;
|
||||
color: #EEE;
|
||||
|
||||
margin: 0;
|
||||
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
|
||||
text-shadow: 5px 5px 5px black;
|
||||
}
|
||||
|
||||
#fullscreen {
|
||||
position: fixed;
|
||||
top: 0
|
||||
right: 0;
|
||||
|
||||
z-index: 1;
|
||||
|
||||
display: none;
|
||||
|
||||
border: solid 2px #EEE;
|
||||
border-radius: 20px;
|
||||
padding: 1em 2em;
|
||||
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#fullscreen:hover {
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body onload="window.onresize();">
|
||||
<div id="blocker">
|
||||
<h1 id="loading">Your application is loading.</h1>
|
||||
<div id="fullscreen" onclick="goFS();">
|
||||
<h1>Start</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div id="gameContainer"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2982da19c4c02ad4b8fb823d548a8ff0
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
Reference in a new issue