静下心来我还是可以的-unitywebgl 滑动条增加

<!DOCTYPE html>

<html lang="en-us">

<head>

<meta charset="utf-8" />

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Unity WebGL Player | QuFuBaoDianWebGL</title>

<link rel="stylesheet" href="TemplateData/style.css" /> <!--增加样式-->

</head>

<body>

<canvas id="unity-canvas"></canvas>

<div id="unity-loading-bar">

<div id="unity-progress-bar-empty">

<div id="unity-progress-bar-full"></div>

</div>

</div>

<script src="Build/DaTongBuild20240424.loader.js"></script>

<script src="./Extend.js"></script>

<script>

var canvas = document.querySelector("#unity-canvas");

const config =

{

dataUrl: "Build/DaTongBuild20240424.data.unityweb",

frameworkUrl: "Build/DaTongBuild20240424.framework.js.unityweb",

codeUrl: "Build/DaTongBuild20240424.wasm.unityweb",

streamingAssetsUrl: "StreamingAssets",

companyName: "DefaultCompany",

productName: "QuFuBaoDianWebGL",

productVersion: "0.1",

};

/*增加显示*/

document.querySelector("#unity-loading-bar").style.display = "block";

createUnityInstance(canvas, config, (progress) =>

{

document.querySelector("#unity-progress-bar-full").style.width =

100 * progress + "%";

}).then((unityInstance) => {

document.querySelector("#unity-loading-bar").style.display = "none";

}).catch((message) => {

alert(message);

});

</script>

</body>

</html>


body,html {

padding: 0;

margin: 0;

width: 100%;

height: 100%;

overflow: hidden;

}

#unity-canvas {

width: 100%;

height: 100%;

background: #231f20

}

#unity-loading-bar {

position: absolute;

left: 50%;

top: 50%;

transform: translate(-50%, -50%);

display: none;

z-index: 1000;

}

#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;

margin-left: 6.5px;

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

}

相关推荐
牛哇网络工作室5 小时前
UnityHDRP写实数字人全流程基础5—语音输入和语音识别
android·unity·c#·游戏引擎·aigc·语音识别·xcode
2501_926978337 小时前
AGI 的四种瓶颈:资源型还是发现型--以及DSH的位置
人工智能·经验分享·笔记·ai写作
LuminousCPP12 小时前
栈和队列专题(一):LeetCode 20. 有效的括号
数据结构·经验分享·笔记·leetcode·手写栈
上海广测检测科技有限公司15 小时前
投影仪ETL认证技术解读:光源安全评估与测试框架
经验分享
ellis197016 小时前
u3d插件xLua[九]例8 Hotfix
unity
淡海水16 小时前
01-07-运行时-GC深度剖析-内存分配回收与结构选择
jvm·windows·unity·gc
薰珞婷紫小亭子16 小时前
如何解决IEEE期刊LaTeX 模版编译pdf出现大空白的问题
经验分享·pdf
SmalBox18 小时前
【节点】[PolarCoordinates节点]原理解析与实际应用
unity3d·游戏开发·图形学
优梦创客19 小时前
游戏开发架构选型:第1篇|什么是架构?从进球事件看 MVC 的局限
unity·架构·游戏引擎·游戏开发
2501_9180273120 小时前
DPO 对齐训练如何避免 token 贡献一刀切?Se-DPO 自演化 Token Credit 方法解析
经验分享