Skip to content

Commit bc4ff0a

Browse files
committed
Initial commit
0 parents  commit bc4ff0a

12 files changed

Lines changed: 622 additions & 0 deletions

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

Build/UnityLoader.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
15 MB
Binary file not shown.

Build/rolling_sky_trip_v18.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"TOTAL_MEMORY": 268435456,
3+
"dataUrl": "rolling_sky_trip_v18.data.unityweb",
4+
"wasmCodeUrl": "rolling_sky_trip_v18.wasm.code.unityweb",
5+
"wasmFrameworkUrl": "rolling_sky_trip_v18.wasm.framework.unityweb",
6+
"asmCodeUrl": "rolling_sky_trip_v18.asm.code.unityweb",
7+
"asmMemoryUrl": "rolling_sky_trip_v18.asm.memory.unityweb",
8+
"asmFrameworkUrl": "rolling_sky_trip_v18.asm.framework.unityweb",
9+
"splashScreenStyle": "Dark",
10+
"backgroundColor": "#231F20"
11+
}
4.37 MB
Binary file not shown.
138 KB
Binary file not shown.

TemplateData/UnityProgress.js

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
const rootPath = 'TemplateData';
2+
3+
function UnityProgress(gameInstance, progress) {
4+
if (!gameInstance.Module) {
5+
return;
6+
}
7+
8+
if (!gameInstance.logo) {
9+
gameInstance.logo = document.createElement("div");
10+
gameInstance.logo.className = "logo " + gameInstance.Module.splashScreenStyle;
11+
gameInstance.container.appendChild(gameInstance.logo);
12+
}
13+
14+
if (!gameInstance.progress) {
15+
gameInstance.progress = document.createElement("div");
16+
gameInstance.progress.className = "progress " + gameInstance.Module.splashScreenStyle;
17+
gameInstance.progress.empty = document.createElement("div");
18+
gameInstance.progress.empty.className = "empty";
19+
gameInstance.progress.appendChild(gameInstance.progress.empty);
20+
gameInstance.progress.full = document.createElement("div");
21+
gameInstance.progress.full.className = "full";
22+
gameInstance.progress.appendChild(gameInstance.progress.full);
23+
gameInstance.container.appendChild(gameInstance.progress);
24+
gameInstance.textProgress = document.createElement("div");
25+
gameInstance.textProgress.className = "text";
26+
gameInstance.container.appendChild(gameInstance.textProgress);
27+
}
28+
29+
gameInstance.progress.full.style.width = (100 * progress) + "%";
30+
gameInstance.progress.empty.style.width = (100 * (1 - progress)) + "%";
31+
gameInstance.textProgress.innerHTML = 'Loading: ' + Math.floor(progress * 100) + '%' + ' <img src="' + rootPath + '/gears.gif" class="spinner" />';
32+
33+
if (progress == 1) {
34+
gameInstance.textProgress.innerHTML = 'Running, Please Wait.. <img src="' + rootPath + '/gears.gif" class="spinner" />';
35+
}
36+
37+
if (progress == 'complete') {
38+
SendMessage = gameInstance.SendMessage;
39+
gameInstance.logo.style.display = 'none';
40+
gameInstance.progress.style.display = 'none';
41+
gameInstance.textProgress.style.display = 'none';
42+
}
43+
}
44+
45+
window.Game = (function() {
46+
var Game = function() {
47+
this.registerEvents();
48+
};
49+
50+
Game.prototype.registerEvents = function() {
51+
var _this = this;
52+
/*
53+
window.addEventListener("keydown", function(e) {
54+
// space and arrow keys
55+
if ([8, 37, 38, 39, 40].indexOf(e.keyCode) > -1) {
56+
e.preventDefault();
57+
}
58+
}, false);
59+
60+
document.onmousedown = function() {
61+
window.focus();
62+
};
63+
*/
64+
document.addEventListener('DOMContentLoaded', function() {
65+
_this.resize();
66+
}, false);
67+
68+
window.addEventListener('resize', function() {
69+
setTimeout(function() {
70+
_this.resize();
71+
}, 1000);
72+
}, false);
73+
};
74+
75+
Game.prototype.getQueryVariable = function(variable) {
76+
var query = window.location.search.substring(1);
77+
var vars = query.split("&");
78+
for (var i = 0; i < vars.length; i++) {
79+
var pair = vars[i].split("=");
80+
if (pair[0] == variable) {
81+
return pair[1];
82+
}
83+
}
84+
return (false);
85+
}
86+
87+
Game.prototype.resize = function() {
88+
var gameContainer = document.getElementById('gameContainer');
89+
var canvas = document.getElementById('#canvas');
90+
91+
var ratioTolerant = this.getQueryVariable('ratio_tolerant');
92+
var gameSizeRatio = gameContainer.getAttribute('width') / gameContainer.getAttribute('height');
93+
94+
if ((!document.mozFullScreen && !document.webkitIsFullScreen)) {
95+
//FullScreen is disabled
96+
var maxHeight = window.innerHeight - 43; // minus the footer
97+
} else {
98+
//FullScreen is enabled
99+
var maxHeight = window.innerHeight; // minus the footer
100+
101+
}
102+
103+
//var maxHeight = window.innerHeight - 43; // minus the footer
104+
var maxWidth = window.innerWidth;
105+
var windowSizeRatio = maxWidth / maxHeight;
106+
var newStyle = {
107+
width: gameContainer.getAttribute('width'),
108+
height: gameContainer.getAttribute('height')
109+
};
110+
if (ratioTolerant) {
111+
if (ratioTolerant == 'true') {
112+
newStyle = {
113+
width: maxWidth,
114+
height: maxHeight
115+
};
116+
} else if (ratioTolerant == 'false') {
117+
if (gameSizeRatio > windowSizeRatio) {
118+
newStyle = {
119+
width: maxWidth,
120+
height: maxWidth / gameSizeRatio
121+
};
122+
} else {
123+
newStyle = {
124+
width: maxHeight * gameSizeRatio,
125+
height: maxHeight
126+
};
127+
}
128+
}
129+
130+
this.updateStyle(gameContainer, newStyle);
131+
// canvas does not exists on page load
132+
if (canvas) {
133+
this.updateStyle(canvas, newStyle);
134+
}
135+
}
136+
};
137+
138+
Game.prototype.updateStyle = function(element, size) {
139+
element.setAttribute('width', size.width);
140+
element.setAttribute('height', size.height);
141+
element.style.width = size.width + 'px';
142+
element.style.height = size.height + 'px';
143+
};
144+
145+
return Game;
146+
})();
147+
148+
var game = new Game();

TemplateData/fullscreen.png

345 Bytes
Loading

TemplateData/gears.gif

7.72 KB
Loading

TemplateData/style.css

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
.webgl-content * {
2+
border: 0;
3+
margin: 0;
4+
padding: 0;
5+
}
6+
7+
/*#gameContainer canvas {
8+
display: block;
9+
background: #222;
10+
}*/
11+
12+
.webgl-content {
13+
position: absolute;
14+
top: 50%;
15+
left: 50%;
16+
-webkit-transform: translate(-50%, -50%);
17+
transform: translate(-50%, -50%);
18+
}
19+
20+
.webgl-content .logo,
21+
.progress,
22+
.text {
23+
position: absolute;
24+
left: 50%;
25+
top: 45%;
26+
-webkit-transform: translate(-50%, -50%);
27+
transform: translate(-50%, -50%);
28+
}
29+
30+
.webgl-content .logo {
31+
background: url("y8-logo.png") no-repeat center / contain;
32+
width: 250px;
33+
height: 250px;
34+
}
35+
36+
.webgl-content .progress {
37+
height: 18px;
38+
width: 211px;
39+
margin-top: 120px;
40+
}
41+
42+
.webgl-content .progress .empty {
43+
background: url("progressEmpty.Light.png") no-repeat right / cover;
44+
float: right;
45+
width: 100%;
46+
height: 100%;
47+
display: inline-block;
48+
}
49+
50+
.webgl-content .progress .full {
51+
background: url("progressFull.Light.png") no-repeat left / cover;
52+
float: left;
53+
width: 0%;
54+
height: 100%;
55+
display: inline-block;
56+
}
57+
58+
.webgl-content .text {
59+
margin-top: 160px;
60+
color: white;
61+
font-family: Arial, Helvetica, Verdana, sans-serif;
62+
font-weight: 700;
63+
font-size: 20px;
64+
}
65+
66+
.webgl-content .spinner {
67+
vertical-align: middle;
68+
}
69+
70+
.webgl-content .progress.Dark .empty {
71+
background: white;
72+
}
73+
74+
.webgl-content .progress.Dark .full {
75+
background: red;
76+
}
77+
78+
.webgl-content .footer {
79+
margin-top: 5px;
80+
height: 38px;
81+
line-height: 38px;
82+
font-family: Helvetica, Verdana, Arial, sans-serif;
83+
font-size: 18px;
84+
background: #fff;
85+
}
86+
87+
.webgl-content .footer .webgl-logo,
88+
.title,
89+
.fullscreen {
90+
height: 100%;
91+
display: inline-block;
92+
background: transparent center no-repeat;
93+
}
94+
95+
.webgl-content .footer .webgl-logo {
96+
width: 204px;
97+
float: left;
98+
}
99+
100+
.webgl-content .footer .title {
101+
margin-right: 10px;
102+
float: right;
103+
}
104+
105+
.webgl-content .footer .fullscreen {
106+
background-image: url("fullscreen.png");
107+
width: 38px;
108+
float: right;
109+
}
110+
/*.webgl-content #gameContainer {
111+
//background: #4D4D4D !important;
112+
}*/

0 commit comments

Comments
 (0)