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

}

相关推荐
HRTOS20 小时前
HRTOS:一个名字背后的目标——不断逼近硬实时
经验分享·单片机·系统架构·51单片机
零基础12320 小时前
DeepSeek V4.1 Flash (Batch) 的性能测试与应用
经验分享·python·语言模型·vllm
零基础1231 天前
Agent 的 Memory 怎么做科研:以中医诊断场景为例
人工智能·经验分享·python·语言模型
路远的数据库笔记1 天前
SQL Server迁移国产数据库怎么做?九套口岸库零停机割接实战
数据库·经验分享·sqlserver·dba
零基础1231 天前
LLM Agent 驱动的物模型构建:从设备手册到边缘接入的自动化实践
运维·人工智能·经验分享·python·自动化
杨逢昌工厂6S管理1 天前
109-杨逢昌车间管理负熵循环:三环体系持续输出负熵的机制解析
经验分享·笔记·职场和发展·学习方法
2601_967212721 天前
电源轨道系统核心技术路线对比与选型要点
大数据·经验分享
老花眼猫1 天前
数学艺术图案画-曼陀罗(93)
c语言·经验分享·青少年编程·课程设计
Go Work1 天前
实体类字段用 @Value 赋了默认值,取出来还是 null?
经验分享·笔记
杨连江1 天前
新生儿胆红素代谢异常致细胞结晶性损伤的致死机制研究
经验分享