Files
MuHua-UIElements/Packages/UITool/Runtime/ModuleUIPanel/UIComponent/UIProgres.cs
T
MuHua-123 39d9db9c6d 1
2025-06-20 17:30:54 +08:00

31 lines
768 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using MuHua;
/// <summary>
/// 加载进度
/// </summary>
public class UIProgres : ModuleUIPanel {
public UISliderH progress;
public VisualElement Progress => element.Q<VisualElement>("Progress");
public Label Title => Progress.Q<Label>("Title");
public UIProgres(VisualElement element) : base(element) {
progress = new UISliderH(Progress, element);
}
/// <summary>
/// 设置进度(0-1
/// </summary>
/// <param name="value"></param>
public void Settings(bool active, string content = "", float value = 0) {
Title.text = content;
progress.UpdateValue(value, false);
element.EnableInClassList("document-page-hide", !active);
}
}