静下心来我还是可以的-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

}

相关推荐
三流架构师几秒前
口腔医学教程资源合集
经验分享
Zik----34 分钟前
简单的Unity漫游场景搭建
unity·游戏引擎
JMchen1231 小时前
Android网络安全实战:从HTTPS到双向认证
android·经验分享·网络协议·安全·web安全·https·kotlin
熊猫不是猫QAQ1 小时前
想要真正的私密分享?NasChat把NAS变成专属TG,隐私+自由
经验分享
掌心向暖RPA自动化1 小时前
影刀RPA如何在网页和桌面软件中实现自动滚动长截图?最好同时支持横向滚动纵向滚动的?
经验分享·自动化·影刀rpa·长截图
eyun_185001 小时前
把健康小屋搬进单位 让职工暖心 让履职安心
大数据·人工智能·经验分享
计算机小手1 小时前
Docker 部署 OpenClaw 汉化版,畅玩个人 AI 智能代理
经验分享·docker·aigc·开源软件
星纬智联技术3 小时前
[开源] myclaw:2000 行 Go 平替 43 万行的 OpenClaw
经验分享
在路上看风景11 小时前
4.5 顶点和片元
unity
SmalBox11 小时前
【节点】[DiffusionProfile节点]原理解析与实际应用
unity3d·游戏开发·图形学