From 6b8a4f07d4ecd8f9ac3c15db6cb9c7b5b244ad0c Mon Sep 17 00:00:00 2001 From: qiudan <1044775178@qq.com> Date: Fri, 8 Dec 2023 15:27:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/VideoWeb/index.html | 528 ++++++++++++++++++---------------- public/analysisWeb/index.html | 83 +++--- 2 files changed, 323 insertions(+), 288 deletions(-) diff --git a/public/VideoWeb/index.html b/public/VideoWeb/index.html index 0285257..b97024e 100644 --- a/public/VideoWeb/index.html +++ b/public/VideoWeb/index.html @@ -1,327 +1,349 @@ - - - - Unity WebGL Player | Painter - - - - - -
- -
- -
-
-
-
-
- -
+ + + + Unity WebGL Player | Painter + + + + + + +
+ +
+ +
+
- - - - + console.log("getInterfaceComponentId", data) //接口组件id + console.log("data2", data2) //组件id + console.log("data3", data3) //类型 + if (data != undefined) { + // window.parent.getZhuanFaMQTT(data,data2,data3); + } + } + + function AddMonqjktx_Error(data) { + console.log("AddMonqjktx_Error", data) + window.parent.AddMonqjktx_Error(data); + } + document.body.appendChild(script); + + + + + \ No newline at end of file diff --git a/public/analysisWeb/index.html b/public/analysisWeb/index.html index 37ccb43..aefa258 100644 --- a/public/analysisWeb/index.html +++ b/public/analysisWeb/index.html @@ -49,18 +49,23 @@ // user. function unityShowBanner(msg, type) { function updateBannerVisibility() { - warningBanner.style.display = warningBanner.children.length ? 'block' : 'none'; + if (warningBanner) { + 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); + if (warningBanner) { + 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(); } @@ -98,35 +103,42 @@ // To lower canvas resolution on mobile devices to gain some // performance, uncomment the following line: // config.devicePixelRatio = 1; - - canvas.style.width = window.innerWidth + 'px'; - canvas.style.height = window.innerHeight + 'px'; + if (canvas) { + canvas.style.width = window.innerWidth + 'px'; + canvas.style.height = window.innerHeight + 'px'; + } unityShowBanner('WebGL builds are not supported on mobile devices.'); } else { // Desktop style: Render the game canvas in a window that can be maximized to fullscreen: - - canvas.style.width = "100%"; - canvas.style.height = "100%"; + if (canvas) { + canvas.style.width = "100%"; + canvas.style.height = "100%"; + } + } + if (loadingBar) { + loadingBar.style.display = "block"; } - - loadingBar.style.display = "block"; var script = document.createElement("script"); var unityInstanceA script.src = loaderUrl; script.onload = () => { - createUnityInstance(canvas, config, (progress) => { - progressBarFull.style.width = 100 * progress + "%"; - }).then((unityInstance) => { - unityInstanceA = unityInstance - loadingBar.style.display = "none"; - fullscreenButton.onclick = () => { - unityInstance.SetFullscreen(1); - }; - }).catch((message) => { - alert(message); - }); + if (canvas) { + createUnityInstance(canvas, config, (progress) => { + progressBarFull.style.width = 100 * progress + "%"; + }).then((unityInstance) => { + unityInstanceA = unityInstance + if (loadingBar) { + loadingBar.style.display = "none"; + } + fullscreenButton.onclick = () => { + unityInstance.SetFullscreen(1); + }; + }).catch((message) => { + alert('createUnityInstance' + message); + }); + } }; //unity初始化 function OnSceneLoaded() { @@ -136,6 +148,7 @@ function Started() { window.parent.started(); } + function getDianwei(string) { unityInstanceA.SendMessage('GameManager', 'ReceptionVideoIdSececeTwo', JSON.stringify(string)); } @@ -204,8 +217,8 @@ unityInstanceA.SendMessage('AAA', 'ChosePoint', params); } //新增点 - function addPoint(id,name) { - let params = id+','+name + function addPoint(id, name) { + let params = id + ',' + name unityInstanceA.SendMessage('AAA', 'AddPoint', params); } //删除点 @@ -217,9 +230,9 @@ unityInstanceA.SendMessage('AAA', 'EditorPoint', params); } //完成编辑 - function editorOverPoint(id,name) { - let params = id+','+name - console.log(params,'params'); + function editorOverPoint(id, name) { + let params = id + ',' + name + console.log(params, 'params'); unityInstanceA.SendMessage('AAA', 'EditorOverPoint', params); } document.body.appendChild(script);