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

}

相关推荐
dexi.Chi 攻城狮2 小时前
SQL层次查询语法
经验分享·笔记·sql
阿星AI工作室2 小时前
WorkBuddy接入deepseek等9款平价大模型,告别积分焦虑
经验分享
BomanZQT2 小时前
NSK UPFC 2040-1 极速精密滚珠丝杠详述
经验分享·规格说明书
杨连江4 小时前
可变级数LC无源自均压海量级联多电平拓扑机理研究——代替传统LCC/MMC的新一代特高压直流逆变架构
经验分享
_zhourui_h_5 小时前
MyFramework:Unity大型项目里的 UI 生命周期应该怎么管理
unity3d
Xi-Xu7 小时前
什么时候需要 Multi-agent:不是分工,而是运行边界
人工智能·经验分享·安全
SmalBox8 小时前
【节点】[IrisOutOfBoundColorClamp节点]原理解析与实际应用
unity3d·游戏开发·图形学
LaughingZhu8 小时前
Product Hunt 每日热榜 | 2026-07-05
人工智能·经验分享·深度学习·神经网络·产品运营
Ethan的技术工坊8 小时前
Unity Windows 客户端从 Mono 切换到 IL2CPP 后,安装包体积翻倍的排查记录
unity3d
黑科技iOS上架8 小时前
分享一个开源的iOS应用AppIcon生成器
经验分享·ios