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