提交模板
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 9d4fc0d476ca0f24d8f71682207ff410
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@ -1,42 +0,0 @@
|
|||||||
#if USE_DATA_CACHING
|
|
||||||
const cacheName = {{{JSON.stringify(COMPANY_NAME + "-" + PRODUCT_NAME + "-" + PRODUCT_VERSION )}}};
|
|
||||||
const contentToCache = [
|
|
||||||
"Build/{{{ LOADER_FILENAME }}}",
|
|
||||||
"Build/{{{ FRAMEWORK_FILENAME }}}",
|
|
||||||
#if USE_THREADS
|
|
||||||
"Build/{{{ WORKER_FILENAME }}}",
|
|
||||||
#endif
|
|
||||||
"Build/{{{ DATA_FILENAME }}}",
|
|
||||||
"Build/{{{ CODE_FILENAME }}}",
|
|
||||||
"TemplateData/style.css"
|
|
||||||
|
|
||||||
];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
self.addEventListener('install', function (e) {
|
|
||||||
console.log('[Service Worker] Install');
|
|
||||||
|
|
||||||
#if USE_DATA_CACHING
|
|
||||||
e.waitUntil((async function () {
|
|
||||||
const cache = await caches.open(cacheName);
|
|
||||||
console.log('[Service Worker] Caching all: app shell and content');
|
|
||||||
await cache.addAll(contentToCache);
|
|
||||||
})());
|
|
||||||
#endif
|
|
||||||
});
|
|
||||||
|
|
||||||
#if USE_DATA_CACHING
|
|
||||||
self.addEventListener('fetch', function (e) {
|
|
||||||
e.respondWith((async function () {
|
|
||||||
let response = await caches.match(e.request);
|
|
||||||
console.log(`[Service Worker] Fetching resource: ${e.request.url}`);
|
|
||||||
if (response) { return response; }
|
|
||||||
|
|
||||||
response = await fetch(e.request);
|
|
||||||
const cache = await caches.open(cacheName);
|
|
||||||
console.log(`[Service Worker] Caching new resource: ${e.request.url}`);
|
|
||||||
cache.put(e.request, response.clone());
|
|
||||||
return response;
|
|
||||||
})());
|
|
||||||
});
|
|
||||||
#endif
|
|
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: bc6d81836f742064586258814b458390
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 297decf63e0b5474b908d74d55a591fb
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
Before Width: | Height: | Size: 104 KiB |
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 44660a77d19cbda47bf37300cd81f67e
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 135d20c71d0e355499d2184192a1109e
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
Before Width: | Height: | Size: 5.5 KiB |
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 800bc3195f68c26428cb22d1bf142d00
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
Before Width: | Height: | Size: 5.5 KiB |
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 3f86a4f3a94f7a64a8b33741ff339a1e
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
Before Width: | Height: | Size: 96 B |
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 434f202128c979e4a8e4f10b14f24dab
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
Before Width: | Height: | Size: 109 B |
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: b4564cdc74e41de43a23fb9c98a868be
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
Before Width: | Height: | Size: 74 B |
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: fe87430c020540f4fa0475e767d41f45
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
Before Width: | Height: | Size: 84 B |
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 08639a499d35cbc4582af018856590ba
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@ -1,12 +0,0 @@
|
|||||||
body { padding: 0; margin: 0 }
|
|
||||||
#unity-container { position: fixed; width: 100%; height: 100%; }
|
|
||||||
#unity-canvas { width: 100%; height: 100%; background: {{{ BACKGROUND_COLOR }}} }
|
|
||||||
#unity-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none }
|
|
||||||
#unity-logo {
|
|
||||||
width: 154px;
|
|
||||||
height: 130px;
|
|
||||||
background: url('新聚力.png') no-repeat center
|
|
||||||
}
|
|
||||||
#unity-progress-bar-empty { margin-left: auto; margin-right: auto; width: 141px; height: 18px; margin-top: 10px; background: url('progress-bar-empty-{{{ SPLASH_SCREEN_STYLE.toLowerCase() }}}.png') no-repeat center }
|
|
||||||
#unity-progress-bar-full { width: 0%; height: 18px; margin-top: 10px; background: url('progress-bar-full-{{{ SPLASH_SCREEN_STYLE.toLowerCase() }}}.png') no-repeat center }
|
|
||||||
#unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }
|
|
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 1bf36439eedabd14ab0ec6a07f782ae3
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
Before Width: | Height: | Size: 3.0 KiB |
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 1dc8c4241843fe24eb549c942aad90a1
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
Before Width: | Height: | Size: 3.0 KiB |
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: a5c44bae5a932ca43923c868648d0909
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
Before Width: | Height: | Size: 11 KiB |
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 331420d07dd44c3478142b4e8f478033
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@ -1,118 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en-us">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
||||||
<title>新聚力-新日仿真</title>
|
|
||||||
<link rel="shortcut icon" href="TemplateData/favicon.ico">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="TemplateData/style.css">
|
|
||||||
<link rel="manifest" href="manifest.webmanifest">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="unity-container">
|
|
||||||
<canvas id="unity-canvas" width={{{ WIDTH }}} height={{{ HEIGHT }}} tabindex="-1"></canvas>
|
|
||||||
<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 id="unity-warning"> </div>
|
|
||||||
</div>
|
|
||||||
<script>
|
|
||||||
window.addEventListener("load", function () {
|
|
||||||
if ("serviceWorker" in navigator) {
|
|
||||||
navigator.serviceWorker.register("ServiceWorker.js");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
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 warningBanner = document.querySelector("#unity-warning");
|
|
||||||
|
|
||||||
// Shows a temporary message banner/ribbon for a few seconds, or
|
|
||||||
// a permanent error message on top of the canvas if type=='error'.
|
|
||||||
// If type=='warning', a yellow highlight color is used.
|
|
||||||
// Modify or remove this function to customize the visually presented
|
|
||||||
// way that non-critical warnings and error messages are presented to the
|
|
||||||
// user.
|
|
||||||
function unityShowBanner(msg, type) {
|
|
||||||
function updateBannerVisibility() {
|
|
||||||
warningBanner.style.display = warningBanner.children.length ? 'block' : 'none';
|
|
||||||
}
|
|
||||||
var div = document.createElement('div');
|
|
||||||
div.innerHTML = msg;
|
|
||||||
warningBanner.appendChild(div);
|
|
||||||
if (type == 'error') div.style = 'background: red; padding: 10px;';
|
|
||||||
else {
|
|
||||||
if (type == 'warning') div.style = 'background: yellow; padding: 10px;';
|
|
||||||
setTimeout(function() {
|
|
||||||
warningBanner.removeChild(div);
|
|
||||||
updateBannerVisibility();
|
|
||||||
}, 5000);
|
|
||||||
}
|
|
||||||
updateBannerVisibility();
|
|
||||||
}
|
|
||||||
|
|
||||||
var buildUrl = "Build";
|
|
||||||
var loaderUrl = buildUrl + "/{{{ LOADER_FILENAME }}}";
|
|
||||||
var config = {
|
|
||||||
dataUrl: buildUrl + "/{{{ DATA_FILENAME }}}",
|
|
||||||
frameworkUrl: buildUrl + "/{{{ FRAMEWORK_FILENAME }}}",
|
|
||||||
#if USE_THREADS
|
|
||||||
workerUrl: buildUrl + "/{{{ WORKER_FILENAME }}}",
|
|
||||||
#endif
|
|
||||||
#if USE_WASM
|
|
||||||
codeUrl: buildUrl + "/{{{ CODE_FILENAME }}}",
|
|
||||||
#endif
|
|
||||||
#if MEMORY_FILENAME
|
|
||||||
memoryUrl: buildUrl + "/{{{ MEMORY_FILENAME }}}",
|
|
||||||
#endif
|
|
||||||
#if SYMBOLS_FILENAME
|
|
||||||
symbolsUrl: buildUrl + "/{{{ SYMBOLS_FILENAME }}}",
|
|
||||||
#endif
|
|
||||||
streamingAssetsUrl: "StreamingAssets",
|
|
||||||
companyName: {{{ JSON.stringify(COMPANY_NAME) }}},
|
|
||||||
productName: {{{ JSON.stringify(PRODUCT_NAME) }}},
|
|
||||||
productVersion: {{{ JSON.stringify(PRODUCT_VERSION) }}},
|
|
||||||
showBanner: unityShowBanner,
|
|
||||||
};
|
|
||||||
|
|
||||||
// By default Unity keeps WebGL canvas render target size matched with
|
|
||||||
// the DOM size of the canvas element (scaled by window.devicePixelRatio)
|
|
||||||
// Set this to false if you want to decouple this synchronization from
|
|
||||||
// happening inside the engine, and you would instead like to size up
|
|
||||||
// the canvas DOM size and WebGL render target sizes yourself.
|
|
||||||
// config.matchWebGLToCanvasSize = false;
|
|
||||||
|
|
||||||
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
|
|
||||||
// Mobile device style: fill the whole browser client area with the game canvas:
|
|
||||||
var meta = document.createElement('meta');
|
|
||||||
meta.name = 'viewport';
|
|
||||||
meta.content = 'width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes';
|
|
||||||
document.getElementsByTagName('head')[0].appendChild(meta);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if BACKGROUND_FILENAME
|
|
||||||
canvas.style.background = "url('" + buildUrl + "/{{{ BACKGROUND_FILENAME.replace(/'/g, '%27') }}}') center / cover";
|
|
||||||
#endif
|
|
||||||
loadingBar.style.display = "block";
|
|
||||||
|
|
||||||
var script = document.createElement("script");
|
|
||||||
script.src = loaderUrl;
|
|
||||||
script.onload = () => {
|
|
||||||
createUnityInstance(canvas, config, (progress) => {
|
|
||||||
progressBarFull.style.width = 100 * progress + "%";
|
|
||||||
}).then((unityInstance) => {
|
|
||||||
loadingBar.style.display = "none";
|
|
||||||
}).catch((message) => {
|
|
||||||
alert(message);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
document.body.appendChild(script);
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 5851b6438c73ab74289fc87555f9a954
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"name": {{{ JSON.stringify(PRODUCT_NAME) }}},
|
|
||||||
"short_name": {{{ JSON.stringify(PRODUCT_NAME) }}},
|
|
||||||
"start_url": "index.html",
|
|
||||||
"display": "fullscreen",
|
|
||||||
"background_color": "{{{ BACKGROUND_COLOR }}}",
|
|
||||||
"theme_color": "{{{ SPLASH_SCREEN_STYLE.toLowerCase() === 'light' ? '#fff' : '#000' }}}",
|
|
||||||
"description": {{{ JSON.stringify(PRODUCT_DESCRIPTION) }}},
|
|
||||||
"icons": [{
|
|
||||||
"src": "TemplateData/icons/unity-logo-{{{ SPLASH_SCREEN_STYLE.toLowerCase() }}}.png",
|
|
||||||
"sizes": "144x144",
|
|
||||||
"type": "image/png",
|
|
||||||
"purpose": "any maskable"
|
|
||||||
}]
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 378f7562b00b9494ea8331d7044b2df1
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|