-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcl2Dshooting.html
More file actions
170 lines (142 loc) · 5.09 KB
/
cl2Dshooting.html
File metadata and controls
170 lines (142 loc) · 5.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Ultimate Game Stash file-->
<!-- For the regularly updating doc go to https://docs.google.com/document/d/1_FmH3BlSBQI7FGgAQL59-ZPe8eCxs35wel6JUyVaG8Q/ -->
<Module>
<ModulePrefs title="Google.com" />
<Content type="html">
<![CDATA[
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Shooter 2D Online</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/dayyiq/fdfd@main/style.css">
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dayyiq/fdfd@main/manifest.webmanifest">
<script src="https://cdn.jsdelivr.net/gh/dayyiq/fdfd@main/v2.f7e6e3b1b621c40bbb17.js"></script>
</head>
<body>
<div id="unity-container">
<canvas id="unity-canvas"></canvas>
</div>
<div id="unity-loading-bar">
<div id="unity-logo"></div>
<div id="unity-progress-bar-empty">
<div id="unity-progress-bar-full"></div>
</div>
</div>
</div>
<script>
window.addEventListener("load", function () {
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("https://cdn.jsdelivr.net/gh/dayyiq/fdfd@main/ServiceWorker.js");
}
});
function onResize() {
var container = canvas.parentElement;
var w;
var h;
if(scaleToFit){
w = window.innerWidth;
h = window.innerHeight;
var r = 1080 / 1920;
if (w * r > window.innerHeight) {
w = Math.min(w, Math.ceil(h / r));
}
h = Math.floor(w * r);
}else {
w = 1920;
h = 1080;
}
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";
}
var container = document.querySelector("#unity-container");
var canvas = document.querySelector("#unity-canvas");
var loadingBar = document.querySelector("#unity-loading-bar");
var progressBarFull = document.querySelector("#unity-progress-bar-full");
var buildUrl = "https://cdn.jsdelivr.net/gh/dayyiq/fdfd@main/Build/";
var loaderUrl = buildUrl + "/dist.loader.js";
var config = {
dataUrl: buildUrl + "/dist.data.unityweb",
frameworkUrl: buildUrl + "/dist.framework.js.unityweb",
codeUrl: buildUrl + "/dist.wasm.unityweb",
streamingAssetsUrl: "StreamingAssets",
companyName: "Games404",
productName: "Shooter2DOnline",
productVersion: "0.0.3"
};
loadingBar.style.display = "block";
var scaleToFit;
try {
scaleToFit = !!JSON.parse("");
} catch (e) {
scaleToFit = true;
}
var script = document.createElement("script");
script.src = loaderUrl;
script.onload = () => {
createUnityInstance(canvas, config, (progress) => {
progressBarFull.style.width = 100 * progress + "%";
}).then((unityInstance) => {
window.Unity = unityInstance;
loadingBar.style.display = "none";
onResize();
});
};
document.body.appendChild(script);
window.addEventListener('resize', onResize);
onResize();
window.addEventListener("blur", function(){
window.Unity.SendMessage('AudioGame', 'AudioBackgroundToggle', 'false');
});
window.addEventListener("focus", function(){
window.Unity.SendMessage('AudioGame', 'AudioBackgroundToggle', 'true');
});
</script>
<script>window.yaContextCb=window.yaContextCb||[]</script>
<script>
var yaContexts = document.querySelectorAll('.ya-context');
var ya_rk_i = 1;
function ShowFixedRK(){
for (var i = 0; i < yaContexts.length; i++) {
yaContexts[i].style.display = 'block';
}
if(window.innerWidth > 991){
window.yaContextCb.push(()=>{
Ya.Context.AdvManager.render({
renderTo: 'yandex_rtb_R-A-1349452-30',
blockId: 'R-A-1349452-30',
pageNumber: ya_rk_i,
})
Ya.Context.AdvManager.render({
renderTo: 'yandex_rtb_R-A-1349452-31',
blockId: 'R-A-1349452-31',
pageNumber: ya_rk_i,
})
})
}
ya_rk_i++;
}
function HideFixedRK(){
for (var i = 0; i < yaContexts.length; i++) {
yaContexts[i].style.display = 'none';
}
}
function showFullscrenAd() {
// sdk.adv.showFullscreenAdv();
}
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
ym(86196628, "init", {
clickmap:true,
trackLinks:true,
accurateTrackBounce:true
});
</script>
</body>
</html>
</Content>
</Module>