Init
8
Assets/WebGLTemplates/SGTemplate/TemplateData.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 202a04227107c6e408072a8642353eb9
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/WebGLTemplates/SGTemplate/TemplateData/favicon.ico
Normal file
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0a95fde47936d4f4cb4aee613b03f3a7
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 175 B |
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 756fe6c6f7a60df4f9ae4869f8e409c3
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 96 B |
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 24bacdd9684816a41a4dbcaa83f1c646
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 109 B |
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eef95e82481d5f74797108fef7496f3d
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 74 B |
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e07475faff1b7a24daaf793e036be736
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 84 B |
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 09b4209279b55b041b91fbdecb876681
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
16
Assets/WebGLTemplates/SGTemplate/TemplateData/style.css
Normal file
@@ -0,0 +1,16 @@
|
||||
body { padding: 0; margin: 0 }
|
||||
#unity-container { position: absolute }
|
||||
#unity-container.unity-desktop { left: 50%; top: 50%; transform: translate(-50%, -50%) }
|
||||
#unity-container.unity-mobile { width: 100%; height: 100% }
|
||||
#unity-canvas { background: #231F20 }
|
||||
.unity-mobile #unity-canvas { width: 100%; height: 100% }
|
||||
#unity-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none }
|
||||
#unity-logo { width: 154px; height: 130px; background: url('unity-logo-dark.png') no-repeat center }
|
||||
#unity-progress-bar-empty { width: 141px; height: 18px; margin-top: 10px; background: url('progress-bar-empty-dark.png') no-repeat center }
|
||||
#unity-progress-bar-full { width: 0%; height: 18px; margin-top: 10px; background: url('progress-bar-full-dark.png') no-repeat center }
|
||||
#unity-footer { position: relative }
|
||||
.unity-mobile #unity-footer { display: none }
|
||||
#unity-webgl-logo { float:left; width: 204px; height: 38px; background: url('webgl-logo.png') no-repeat center }
|
||||
#unity-build-title { float: right; margin-right: 10px; line-height: 38px; font-family: arial; font-size: 18px }
|
||||
#unity-fullscreen-button { float: right; width: 38px; height: 38px; background: url('fullscreen-button.png') no-repeat center }
|
||||
#unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 97cf6e4575aaa964db7951d782b0ddd9
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 44cf5c5fee7e7844e8870bf7e01c691a
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ddd01af0eb33baa4bbb62945f026aebc
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/WebGLTemplates/SGTemplate/TemplateData/webgl-logo.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 455ec0fc2a63a974680afb5e9bcf2515
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/WebGLTemplates/SGTemplate/css.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 62487f5155a385345be1712fc43bba02
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
11600
Assets/WebGLTemplates/SGTemplate/css/bootstrap.min.css
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 592da170a538aed4dacdb75545290093
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
237
Assets/WebGLTemplates/SGTemplate/css/style2.css
Normal file
@@ -0,0 +1,237 @@
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#unity-container.unity-desktop {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
#unity-canvas {
|
||||
width: 100%;
|
||||
height: 100%
|
||||
}
|
||||
|
||||
#unity-loading-bar {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#unity-logo {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: none;
|
||||
background-color: black;
|
||||
/*background: url('../images/index/pic/pic1.jpg') no-repeat center;*/
|
||||
background-size: 100% 100%;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
#boxProgress {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
background: #000000;
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
#bar {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 2;
|
||||
height: 40px;
|
||||
width: 100%;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
font-family: Georgia;
|
||||
clip: rect(0px, 0, 40px, 0px);
|
||||
background: #8B8386;
|
||||
}
|
||||
|
||||
#text {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
color: white;
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
font-family: Georgia;
|
||||
}
|
||||
/*
|
||||
@font-face {
|
||||
font-family: myfont;
|
||||
src: url('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.ttf') format('truetype');
|
||||
}*/
|
||||
|
||||
#title {
|
||||
font-weight: bold;
|
||||
font-family: myfont;
|
||||
color: white;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 15%;
|
||||
transform: translate(-50%, -50%)
|
||||
}
|
||||
|
||||
#mask {
|
||||
display: block;
|
||||
position: absolute;
|
||||
z-index: 9999;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: url('../images/hp.jpg') no-repeat center;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.center-modal {
|
||||
display: none;
|
||||
width: 60%;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
background-color: gray;
|
||||
opacity: 0.8;
|
||||
/*background-image: url('../Images/2.png');*/
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.maxmize-modal {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
background-color: gray;
|
||||
opacity: 0.8;
|
||||
/*background-image: url('../Images/2.png');*/
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
#modalTitle {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
background-image: url('../Images/1.png');
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
#modalContent {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#divView {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
/*width: 100%;
|
||||
position: relative;
|
||||
padding-bottom: 56.25%;*/ /*9<><39><EFBFBD><EFBFBD>16*/
|
||||
/*height: 0;*/
|
||||
}
|
||||
|
||||
#vAnim {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#btnSkip {
|
||||
position: fixed;
|
||||
top: 13px;
|
||||
right: 13px;
|
||||
width: 80px;
|
||||
height: 35px;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
#btnClose {
|
||||
position: fixed;
|
||||
top: 13px;
|
||||
right: 13px;
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
background: url('../images/ui/close.png') no-repeat center;
|
||||
background-size: 100% 100%;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#btnMax {
|
||||
position: fixed;
|
||||
top: 13px;
|
||||
right: 45px;
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
background: url('../images/ui/max.png') no-repeat center;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
#btnPlay {
|
||||
display: none;
|
||||
position: fixed;
|
||||
left: 13px;
|
||||
top: 13px;
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
background: url('../images/ui/play.png') no-repeat center;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
#vdMain {
|
||||
/*width: 100%;*/
|
||||
height: 100%;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#imgMain {
|
||||
width: 100%;
|
||||
height: 100%
|
||||
}
|
||||
|
||||
#imgText {
|
||||
width: inherit;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
#comic {
|
||||
width: inherit;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
#divVideoPlayer {
|
||||
display: none;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: none;
|
||||
background-color: #000000A0;
|
||||
background-size: 100% 100%;
|
||||
justify-content: center;
|
||||
z-index: 9999;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
#vdPlayer {
|
||||
height: 100%;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#vdTitle {
|
||||
text-align: center;
|
||||
font-size:larger;
|
||||
width: 100%;
|
||||
top: 10px;
|
||||
color: white;
|
||||
position: absolute;
|
||||
}
|
||||
7
Assets/WebGLTemplates/SGTemplate/css/style2.css.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5d261731fd60c9a4c9cd0d2f903680eb
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/WebGLTemplates/SGTemplate/css/汉呈王世李行书.ttf
Normal file
7
Assets/WebGLTemplates/SGTemplate/css/汉呈王世李行书.ttf.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: da5f8c95011135a478843f1e51ad083d
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/WebGLTemplates/SGTemplate/images.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dd770956f5fb07d409cf62e6cd8e173b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/WebGLTemplates/SGTemplate/images/UI.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 175c235e1192a0e4e948754cc1fe55b6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/WebGLTemplates/SGTemplate/images/UI/close.png
Normal file
|
After Width: | Height: | Size: 8.8 KiB |
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 618a9ca6d3da5f44481d293bd28b1ffc
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/WebGLTemplates/SGTemplate/images/hp.jpg
Normal file
|
After Width: | Height: | Size: 38 KiB |
7
Assets/WebGLTemplates/SGTemplate/images/hp.jpg.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2229df2e69cae8e40a1b5c98c51774e8
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/WebGLTemplates/SGTemplate/images/loadingTW.jpg
Normal file
|
After Width: | Height: | Size: 394 KiB |
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 85399d2fcdf6fb840a5942af2d433128
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
130
Assets/WebGLTemplates/SGTemplate/index.html
Normal file
@@ -0,0 +1,130 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
|
||||
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
|
||||
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
|
||||
<META HTTP-EQUIV="expires" CONTENT="0">
|
||||
|
||||
<title>台湾历史与文化数字博物馆</title>
|
||||
<link rel="shortcut icon" href="TemplateData/favicon.ico">
|
||||
<link rel="stylesheet" href="TemplateData/style.css">
|
||||
|
||||
<link rel="stylesheet" href="css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="css/style2.css">
|
||||
|
||||
<script src="js/jquery-3.6.1.min.js"></script>
|
||||
<script src="js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
<script src="js/loadProcess.js"></script>
|
||||
<script src="js/dataProcess.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="mask"></div>
|
||||
<div id="unity-container" class="unity-desktop">
|
||||
<canvas id="unity-canvas"></canvas>
|
||||
<div id="unity-loading-bar">
|
||||
<div id="title"><h1></h1></div>
|
||||
<div id="boxProgress" style="display: none;">
|
||||
<div id="bar">0%</div>
|
||||
<div id="text">0%</div>
|
||||
</div>
|
||||
<div id="unity-logo">
|
||||
<video id="vdMain" controls autoplay muted>
|
||||
<source id="vSource" src="StreamingAssets/Video/过渡动画.m4v" type="video/mp4" />
|
||||
</video>
|
||||
<button id="btnSkip" onclick="onBtnSkipClick()">跳过</button>
|
||||
</div>
|
||||
</div>
|
||||
<audio id="adMain" hidden="hidden" loop="loop"></audio>
|
||||
<audio id="adAnother" hidden="hidden"></audio>
|
||||
<div id="unity-warning"></div>
|
||||
</div>
|
||||
<div id="divVideoPlayer">
|
||||
<div id="vdTitle">这是一个标题</div>
|
||||
<video id="vdPlayer" controls autoplay>
|
||||
<source id="vdSource" src="" type="video/mp4" />
|
||||
</video>
|
||||
<div id="btnClose" onclick="onBtnCloseClick()"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 获取div变量
|
||||
var container = document.querySelector("#unity-container");
|
||||
var canvas = document.querySelector("#unity-canvas");
|
||||
var loadingBar = document.querySelector("#unity-loading-bar");
|
||||
var logo = document.querySelector("#unity-logo");
|
||||
var warningBanner = document.querySelector("#unity-warning");
|
||||
var modal = document.querySelector("#modal");
|
||||
var divView = document.querySelector("#divView");
|
||||
var vdMain = document.querySelector("#vdMain");
|
||||
|
||||
vdMain.addEventListener('ended', function () { onBtnSkipClick(); }, false);
|
||||
vdMain.play();
|
||||
// Unity实例
|
||||
var gameInstance = null;
|
||||
|
||||
// 初始化参数
|
||||
var buildUrl = "Build";
|
||||
var loaderUrl = buildUrl + "/WebGL.loader.js";
|
||||
var config = {
|
||||
dataUrl: buildUrl + "/WebGL.data.unityweb",
|
||||
frameworkUrl: buildUrl + "/WebGL.framework.js.unityweb",
|
||||
codeUrl: buildUrl + "/WebGL.wasm.unityweb",
|
||||
streamingAssetsUrl: "StreamingAssets",
|
||||
companyName: "MetaYango",
|
||||
productName: "TW_V1.1",
|
||||
productVersion: "1.1",
|
||||
showBanner: unityShowBanner,
|
||||
};
|
||||
|
||||
// 判断是否为移动设备
|
||||
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
|
||||
// Avoid draining fillrate performance on mobile devices,
|
||||
// and default/override low DPI mode on mobile browsers.
|
||||
container.className = "unity-mobile";
|
||||
config.devicePixelRatio = 1;
|
||||
}
|
||||
|
||||
var script = document.createElement("script");
|
||||
script.src = loaderUrl;
|
||||
script.onload = () => {
|
||||
// showImages(); // 显示图片幻灯片
|
||||
|
||||
createUnityInstance(canvas, config, (progress) => {
|
||||
setOldProgresss(progress); // 设置进度
|
||||
}).then((unityInstance) => { // 进度加载结束后
|
||||
gameInstance = unityInstance; // 保存Unity实例,用于与Unity通信
|
||||
progressCustom(); // 调用自定义进度条
|
||||
}).catch((message) => {
|
||||
alert(message);
|
||||
});
|
||||
};
|
||||
document.body.appendChild(script);
|
||||
|
||||
// 显示错误提示(错误信息,错误类型)
|
||||
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();
|
||||
}
|
||||
</script>
|
||||
|
||||
<script src="js/screenProcess.js"></script>
|
||||
<script src="js/audioProcess.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
7
Assets/WebGLTemplates/SGTemplate/index.html.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8ecd08b5d20e2004490fe1538ffad79d
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/WebGLTemplates/SGTemplate/js.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b001efd2a8746234ebb8056eba72394f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
57
Assets/WebGLTemplates/SGTemplate/js/audioProcess.js
Normal file
@@ -0,0 +1,57 @@
|
||||
var adMain = document.querySelector("#adMain");
|
||||
var adAnother = document.querySelector("#adAnother");
|
||||
|
||||
// 播放第index展厅背景音乐
|
||||
function jsPlayBg(index) {
|
||||
|
||||
adMain.src = "StreamingAssets/Audios/ZT" + index + ".mp3";
|
||||
// adMain.play();
|
||||
|
||||
adMain.load();
|
||||
adMain.currentTime = 0;
|
||||
let playPromise = adMain.play();
|
||||
if (playPromise) {
|
||||
playPromise.then(() => {
|
||||
audio.play();
|
||||
}).catch(() => {
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 暂停背景音乐
|
||||
/// </summary>
|
||||
function jsPauseBackgroundMusic() {
|
||||
adMain.pause();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 恢复背景音乐
|
||||
/// </summary>
|
||||
function jsResumeBackgroundMusic() {
|
||||
adMain.play();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置背景音乐静音
|
||||
/// </summary>
|
||||
function jsSetBackgroundMute() {
|
||||
adMain.muted = !adMain.muted;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 播放音效(默认在摄像机位置播放)
|
||||
/// </summary>
|
||||
function jsPlayAudio(audioName) {
|
||||
adAnother.volume = 0.5;
|
||||
adAnother.src = "StreamingAssets/Audios/" + audioName + ".mp3";
|
||||
adAnother.play();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 停止音效
|
||||
/// </summary>
|
||||
function jsStopAudio() {
|
||||
adAnother.stop();
|
||||
}
|
||||
7
Assets/WebGLTemplates/SGTemplate/js/audioProcess.js.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7814f70edc992b84f98ad4915533daff
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
7
Assets/WebGLTemplates/SGTemplate/js/bootstrap.bundle.min.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b4ea29eef320d4947946f9ffb3de0b0c
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
315
Assets/WebGLTemplates/SGTemplate/js/dataProcess.js
Normal file
@@ -0,0 +1,315 @@
|
||||
/*
|
||||
* @description 是否显示测试用的FPS
|
||||
*/
|
||||
function jsIsShowFPS() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* @description 称判断是否为IOS浏览器
|
||||
*/
|
||||
function isIOSBrowser() {
|
||||
var UA = navigator.userAgent;
|
||||
if (UA.match(/iPad/) || UA.match(/iPhone/) || UA.match(/iPod/)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 加载视图(由Unity调用)
|
||||
* @param {string} data JSON格式数据
|
||||
* 对象格式 class DataInfo{ stirng ObjectID, int Type, string DataName, string[] DataDetails }
|
||||
*/
|
||||
function jsLoadView(data) {
|
||||
// 解析成对象
|
||||
let objData = JSON.parse(data);
|
||||
var dataType;
|
||||
switch (objData.Type) {
|
||||
case 0: dataType = "Video"; break;
|
||||
case 1: dataType = "Image"; break;
|
||||
case 2: dataType = "ImageText"; break;
|
||||
case 3: dataType = "ComicStrip"; break;
|
||||
case 4: dataType = "Game"; break;
|
||||
case 5: dataType = "Url"; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
// 不同类型加载不同的HTML文件
|
||||
var url = dataType + ".html";
|
||||
|
||||
// 文件内容加载到divView
|
||||
var req = false;
|
||||
if (window.XMLHttpRequest) {// Safari, Firefox, 及其他非微软浏览器
|
||||
try {
|
||||
req = new XMLHttpRequest();
|
||||
} catch (e) {
|
||||
req = false;
|
||||
}
|
||||
} else if (window.ActiveXObject) {
|
||||
try {
|
||||
req = new ActiveXObject("Msxml2.XMLHTTP");// For Internet Explorer on Windows
|
||||
} catch (e) {
|
||||
try {
|
||||
req = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
} catch (e) {
|
||||
req = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
var element = document.getElementById("divView");
|
||||
if (!element) {
|
||||
alert("无法找到id为" + id + "的div 或 span 标签。");
|
||||
return;
|
||||
}
|
||||
if (req) {
|
||||
req.open('GET', url, false); // 同步请求,等待收到全部内容
|
||||
req.send(null);
|
||||
element.innerHTML = req.responseText;
|
||||
// $("#divView").html(req.responseText);
|
||||
|
||||
// 自动加载并根据类型加载对应的资源进行显示
|
||||
if (dataType == "Video") {
|
||||
jsLoadVideo(objData);
|
||||
}
|
||||
else if (dataType == "Image") {
|
||||
jsLoadImage(objData);
|
||||
}
|
||||
else if (dataType == "Url") {
|
||||
jsLoadUrl(objData.DataName);
|
||||
}
|
||||
else if (dataType == "ComicStrip") {
|
||||
jsLoadComicStrip(objData.DataName);
|
||||
}
|
||||
else if (dataType == "ImageText") {
|
||||
// 测试写法,不代表最终写法。这里只传递一个参数,图文应该有图片和音频。
|
||||
jsLoadImageText(objData.DataName);
|
||||
}
|
||||
} else {
|
||||
element.innerHTML =
|
||||
"对不起,你的浏览器不支持" + "XMLHTTPRequest 对象。这个网页的显示要求" +
|
||||
"Internet Explorer 5 以上版本, " + "或 Firefox 或 Safari 浏览器,也可能会有其他可兼容的浏览器存在。";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 移动时关闭弹窗并清空divView内容
|
||||
*/
|
||||
function jsHideView() {
|
||||
$('#modal').addClass('center-modal');
|
||||
$('#modal').removeClass('maxmize-modal');
|
||||
modal.style.display = "none";
|
||||
//$('#modal').fadeOut(); // 会有标题在
|
||||
|
||||
var element = document.getElementById("divView");
|
||||
if (!element) {
|
||||
alert("无法找到id为" + id + "的div 或 span 标签。");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
element.innerHTML = "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 加载视频
|
||||
* @param {DataInfo} datainfo 数据信息
|
||||
*/
|
||||
function jsLoadVideo(videoName,videoTitle) {
|
||||
var divVideoPlayer = document.querySelector("#divVideoPlayer");
|
||||
var btnClose = document.querySelector("#btnClose");
|
||||
var vdMain = document.querySelector("#vdPlayer");
|
||||
var vSource = document.querySelector("#vdSource");
|
||||
var vdTitle = document.querySelector("#vdTitle");
|
||||
vSource.src = "StreamingAssets/Video/" + videoName;
|
||||
vdMain.load();
|
||||
divVideoPlayer.style.display = "block";
|
||||
btnClose.style.display = "block";
|
||||
vdTitle.innerHTML = videoTitle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 加载图像
|
||||
* @param {DataInfo} datainfo 数据信息
|
||||
*/
|
||||
function jsLoadImage(datainfo) {
|
||||
var imgMain = document.querySelector("#imgMain");
|
||||
imgMain.src = "Content/Images/" + datainfo.DataName;
|
||||
|
||||
// 如果包含音频,则显示音频播放按钮
|
||||
if (datainfo.DataDetails.length > 1) {
|
||||
var auSource = document.querySelector("#auSource");
|
||||
auSource.src = "Content/Audios/" + datainfo.DataDetails[1];
|
||||
var btnPlay = document.querySelector("#btnPlay");
|
||||
btnPlay.style.display = "block";
|
||||
}
|
||||
|
||||
$('#modal').fadeIn(500);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 图文
|
||||
* @param {string} audioName 音频名称
|
||||
* @param {string} imageName 图片名称
|
||||
*/
|
||||
function jsLoadImageText(audioName, imageName) {
|
||||
var adMain = document.querySelector("#adMain");
|
||||
var aSource = document.querySelector("#aSource");
|
||||
aSource.src = "Content/Audios/" + audioName;
|
||||
// 这里图片应该动态添加,目前是在imageText.html写死
|
||||
$('#imgText').attr('src', 'Content/Images/' + imageName);
|
||||
adMain.load();
|
||||
$('#modal').fadeIn(500);
|
||||
setTimeout(function () {
|
||||
if (!isIOSBrowser()) {
|
||||
adMain.play();
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
|
||||
function jsLoadComicStrip(comicStripName) {
|
||||
$('#comic').attr('src', 'Content/Images/' + comicStripName);
|
||||
$('#modal').fadeIn(500);
|
||||
}
|
||||
|
||||
function jsLoadUrl(url) {
|
||||
window.open(url, "_blank");
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 判断浏览器是否竖屏
|
||||
*/
|
||||
function jsIsBroswerSP() {
|
||||
return window.orientation === 180 || window.orientation === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 判断是否苹果浏览器
|
||||
*/
|
||||
function jsIOSBroswer() {
|
||||
var UA = navigator.userAgent;
|
||||
if (UA.match(/iPad/) || UA.match(/iPhone/) || UA.match(/iPod/)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取平台的类型
|
||||
* @return 0:Unity编辑器,1:非IOS平台,2:IOS平台
|
||||
*/
|
||||
function jsGetPlatformType() {
|
||||
|
||||
return isIOSBrowser() ? 2 : 1;
|
||||
}
|
||||
|
||||
function jsIsWXBrowser()
|
||||
{
|
||||
var ua = navigator.userAgent.toLowerCase();
|
||||
var isWeixin = ua.indexOf('micromessenger') != -1;
|
||||
if (isWeixin) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置全屏显示
|
||||
*/
|
||||
function jsSetFullScreen() {
|
||||
unityInstance.SetFullscreen(1);
|
||||
//canvas.requestFullscreen();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 判断是否为移动端浏览器
|
||||
*/
|
||||
function jsIsMobileBroswerSP() {
|
||||
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 关闭按钮单击事件
|
||||
*/
|
||||
function onBtnCloseClick() {
|
||||
//jsHideView();
|
||||
var divVideoPlayer = document.querySelector("#divVideoPlayer");
|
||||
var btnClose = document.querySelector("#btnClose");
|
||||
var vdMain = document.querySelector("#vdPlayer");
|
||||
vdMain.pause();
|
||||
divVideoPlayer.style.display = "none";
|
||||
btnClose.style.display = "none";
|
||||
gameInstance.SendMessage("H5Receiver", "HideView", "");
|
||||
}
|
||||
|
||||
// 是否为最大化
|
||||
var isModalMax = false;
|
||||
/**
|
||||
* @description 最大化按钮单击事件
|
||||
*/
|
||||
function onBtnMaxClick() {
|
||||
isModalMax = !isModalMax;
|
||||
if (isModalMax) {
|
||||
$('#modal').removeClass('center-modal');
|
||||
$('#modal').addClass('maxmize-modal');
|
||||
$('#modal').fadeIn(500);
|
||||
}
|
||||
else {
|
||||
$('#modal').removeClass('maxmize-modal');
|
||||
$('#modal').addClass('center-modal');
|
||||
$('#modal').fadeIn(500);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 音频播放按钮单击事件
|
||||
*/
|
||||
function onBtnPlayClick() {
|
||||
console.log("play");
|
||||
var auMain = document.querySelector("#auMain");
|
||||
var btnPlay = document.querySelector("#btnPlay");
|
||||
|
||||
if (auMain.paused) {
|
||||
btnPlay.style.backgroundImage = "url('../images/ui/pause.png')";
|
||||
auMain.load();
|
||||
auMain.play();
|
||||
}
|
||||
else {
|
||||
btnPlay.style.backgroundImage = "url('../images/ui/play.png')";
|
||||
auMain.pause();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 关闭按钮单击事件
|
||||
*/
|
||||
function onBtnSkipClick() {
|
||||
|
||||
// jsLoadVideo("ZT0_3_1(台湾名称的由来).mp4");
|
||||
|
||||
vdMain.pause();
|
||||
//vdMain.removeAttribute('src')
|
||||
vdMain.remove();
|
||||
|
||||
document.getElementById('boxProgress').style.display = "block";
|
||||
btnSkip.style.display = "none";
|
||||
|
||||
warningBanner.remove();
|
||||
|
||||
if (newProgress > 100) {
|
||||
hideLoadingBar();
|
||||
gameInstance.SendMessage("H5Receiver", "EnterGame", "");
|
||||
}
|
||||
else {
|
||||
logo.style.backgroundImage = "url('images/loadingTW.jpg')";
|
||||
showImages();
|
||||
}
|
||||
}
|
||||
7
Assets/WebGLTemplates/SGTemplate/js/dataProcess.js.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 73c38f62870ef5d4ab750f0c1908489f
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
2
Assets/WebGLTemplates/SGTemplate/js/jquery-3.6.1.min.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 04c90775e6368e14ab0b58e15ef00b9f
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
87
Assets/WebGLTemplates/SGTemplate/js/loadProcess.js
Normal file
@@ -0,0 +1,87 @@
|
||||
var index = 1;
|
||||
var newProgress;
|
||||
var opa = 1;
|
||||
var loadImg = true;
|
||||
|
||||
|
||||
function setOldProgresss(percent) {
|
||||
newProgress = Math.floor(percent * 100);
|
||||
setProgress(newProgress);
|
||||
}
|
||||
|
||||
function setProgress(percent) {
|
||||
var box = document.getElementById('boxProgress');
|
||||
var bar = document.getElementById('bar');
|
||||
var text = document.getElementById('text');
|
||||
|
||||
var allWidth = window.innerWidth; // parseInt(getStyle(box, 'width'));
|
||||
|
||||
bar.innerHTML = percent + '%';
|
||||
text.innerHTML = percent + '%';
|
||||
|
||||
bar.style.clip = 'rect(0px, ' + percent / 100 * allWidth + 'px, 40px, 0px)';
|
||||
};
|
||||
|
||||
function getStyle(obj, attr) {
|
||||
if (obj.currentStyle) {
|
||||
return obj.currentStyle[attr];
|
||||
} else {
|
||||
return getComputedStyle(obj, false)[attr];
|
||||
}
|
||||
}
|
||||
|
||||
var cusCount = 0;
|
||||
var endOfVideo = false;
|
||||
function progressCustom() {
|
||||
// newProgress += Math.floor(Math.random() * 10);
|
||||
cusCount++;
|
||||
if (cusCount == 5) {
|
||||
newProgress = 101;
|
||||
};
|
||||
|
||||
if (newProgress > 100) {
|
||||
setProgress(100);
|
||||
|
||||
loadImg = false;
|
||||
}
|
||||
else {
|
||||
setProgress(newProgress);
|
||||
setTimeout("progressCustom()", 420);
|
||||
}
|
||||
}
|
||||
|
||||
function hideLoadingBar() {
|
||||
opa -= 0.1;
|
||||
loadingBar.style.opacity = opa;
|
||||
if (opa <= 0) {
|
||||
loadingBar.style.display = "none";
|
||||
}
|
||||
else {
|
||||
setTimeout("hideLoadingBar()", 100);
|
||||
}
|
||||
}
|
||||
|
||||
function showImages() {
|
||||
|
||||
if (newProgress > 100) {
|
||||
hideLoadingBar();
|
||||
gameInstance.SendMessage("H5Receiver", "EnterGame", "");
|
||||
}
|
||||
else {
|
||||
if (loadImg) {
|
||||
setTimeout("showImages()", 2000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function stretchScreen() {
|
||||
var width = window.innerWidth;
|
||||
var height = window.innerHeight;
|
||||
// console.log(width + "," + height);
|
||||
|
||||
canvas.style.width = width + "px";
|
||||
canvas.style.height = height + "px";
|
||||
|
||||
loadingBar.style.width = width + "px";
|
||||
loadingBar.style.height = height + "px";
|
||||
}
|
||||
7
Assets/WebGLTemplates/SGTemplate/js/loadProcess.js.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3892824547c20e148ae5fd6ca3b9cc7d
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
31
Assets/WebGLTemplates/SGTemplate/js/screenProcess.js
Normal file
@@ -0,0 +1,31 @@
|
||||
stretchScreen();
|
||||
|
||||
var mask = document.querySelector("#mask");
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>ĺ<EFBFBD><C4BA><EFBFBD>
|
||||
function handlePortraitOfMobile() {
|
||||
if (window.orientation === 180 || window.orientation === 0) {
|
||||
mask.style.display = "block";
|
||||
} else {
|
||||
mask.style.display = "none";
|
||||
|
||||
setTimeout("stretchScreen()", 200); // <20><>ʱ<EFBFBD><CAB1><EFBFBD>ܻ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD>º<EFBFBD><C2BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
}
|
||||
}
|
||||
|
||||
// <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD>
|
||||
handlePortraitOfMobile();
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><D0BB>¼<EFBFBD>
|
||||
window.addEventListener("orientationchange", handlePortraitOfMobile);
|
||||
window.addEventListener("resize", handlePortraitOfMobile);
|
||||
|
||||
//var evt = "onorientationchange" in window ? "orientationchange" : "resize";
|
||||
//window.addEventListener(evt, function () {
|
||||
// // <20><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD>
|
||||
// handlePortraitOfMobile();
|
||||
//}, false);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7401d4f20c7647e4496908d86a517ae6
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/WebGLTemplates/SGTemplate/web.config
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<system.webServer>
|
||||
<staticContent>
|
||||
<mimeMap fileExtension=".unityweb" mimeType="application/octet-stream" />
|
||||
</staticContent>
|
||||
</system.webServer>
|
||||
</configuration>
|
||||
7
Assets/WebGLTemplates/SGTemplate/web.config.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 701e9b3301af5a74483cfa970daccf57
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||