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

}

相关推荐
星迹日6 分钟前
C语言:结构体
c语言·开发语言·经验分享·笔记
哲伦贼稳妥3 小时前
网络运维故障处理
运维·网络·经验分享·职场和发展
咩咩觉主4 小时前
Unity实战案例全解析 :PVZ 植物脚本分析
unity·游戏引擎
拾忆丶夜4 小时前
Unity3d 以鼠标位置点为中心缩放视角(正交模式下)
unity
猫的饭桌10 小时前
布偶猫应该喂什么猫罐头:交响乐金罐、希喂、尾巴生活测评
经验分享·笔记·安全·生活
半导体守望者11 小时前
AE电源HPG13150 400V Generator 手侧
经验分享·笔记·功能测试·自动化·制造
_oP_i11 小时前
Unity 编辑器设置中文
unity
小安运维日记14 小时前
Linux云计算 |【第三阶段】PROJECT1-DAY3
linux·运维·经验分享·笔记·云计算
生活健康馆15 小时前
【黄力医生】血栓隐患大排查:七类人群如何自我监测静脉血栓风险
经验分享·健康医疗
我命由我1234517 小时前
1.使用 IDEA 过程中的英语积累 - File 菜单(每一次重点积累 5 个单词)
java·ide·经验分享·学习·intellij-idea·idea·学习方法