From cc787289493cc7d6edb2d70a417e552149e7a626 Mon Sep 17 00:00:00 2001 From: yanghua <1475658476@qq.com> Date: Tue, 8 Apr 2025 13:31:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=9E=8D=E5=90=88=E7=A8=8B=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/UI/UIPanel/UI_LoadingPanel.cs | 10 + Assets/Scripts/UI/UIPanel/UI_StepsPanel.cs | 52 +- .../Layouts/CurrentMaximizeLayout.dwlt | 443 +++++++----------- 3 files changed, 195 insertions(+), 310 deletions(-) diff --git a/Assets/Scripts/UI/UIPanel/UI_LoadingPanel.cs b/Assets/Scripts/UI/UIPanel/UI_LoadingPanel.cs index 5712105..66f4785 100644 --- a/Assets/Scripts/UI/UIPanel/UI_LoadingPanel.cs +++ b/Assets/Scripts/UI/UIPanel/UI_LoadingPanel.cs @@ -1,5 +1,6 @@ using System.Collections; using System.Collections.Generic; +using TMPro; using UnityEngine; using UnityEngine.UI; @@ -10,15 +11,22 @@ public class UI_LoadingPanel : BasePanel private float currentProgress = 0; public float speed; public bool isLoading = false; + public TextMeshProUGUI Slider_Text; + public Sprite[] frames; // 将每一帧的Sprite图片依次拖入这个数组中 + public float frameRate = 30f; // 每秒播放的帧数 + private Image image; protected override void Awake() { base.Awake(); loadSlider = GetControl("loadSlider"); + Slider_Text = GetControl("%"); + image = GetControl("middleImage"); } public override void ShowMe() { base.ShowMe(); + Slider_Text.text = "0%"; Bootstrap.Instance.eventCenter.AddEventListener(Enum_EventType.UpdateProgress, UpdateProgress); } @@ -41,6 +49,8 @@ public class UI_LoadingPanel : BasePanel { currentProgress += Time.deltaTime * speed; loadSlider.value = currentProgress; + float percent = loadSlider.value * 100f; + Slider_Text.text = Mathf.RoundToInt(percent) + "%"; } else { diff --git a/Assets/Scripts/UI/UIPanel/UI_StepsPanel.cs b/Assets/Scripts/UI/UIPanel/UI_StepsPanel.cs index 1907b78..d8e2982 100644 --- a/Assets/Scripts/UI/UIPanel/UI_StepsPanel.cs +++ b/Assets/Scripts/UI/UIPanel/UI_StepsPanel.cs @@ -24,7 +24,7 @@ public class UI_StepsPanel : BasePanel public PptFilesData data = new PptFilesData(); public Sprite XuanZhongsprite; - + public string jsonFileName = "StepsConfig"; // JSON文件名 protected override void Awake() @@ -42,7 +42,7 @@ public class UI_StepsPanel : BasePanel var item = Instantiate(StepsItem, StepsContent); item.Init(pptFile.fileName); var buttonText = item.GetComponentInChildren(); - Button button = item.GetComponentInChildren