调整目录结构
This commit is contained in:
@@ -14,6 +14,8 @@ namespace NBF
|
||||
public override string UIPackName => "Load";
|
||||
public override string UIResName => "LoadingPanel";
|
||||
|
||||
[AutoFind(Name = "back")]
|
||||
public GLoader back;
|
||||
[AutoFind(Name = "Progress")]
|
||||
public GProgressBar Progress;
|
||||
[AutoFind(Name = "TextLoading")]
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
using UnityEngine;
|
||||
using NBC;
|
||||
using NBC.Event;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
@@ -17,14 +18,32 @@ namespace NBF
|
||||
}
|
||||
}
|
||||
|
||||
public class OnLoadingProgressEvent : EventSystem<LoadingProgress>
|
||||
{
|
||||
protected override void Handler(LoadingProgress self)
|
||||
{
|
||||
LoadingPanel.SetProgress(self.Progress);
|
||||
}
|
||||
}
|
||||
|
||||
public partial class LoadingPanel : UIPanel
|
||||
{
|
||||
|
||||
public static readonly LoadingTask<LoadingPanel> LoadingTask = new();
|
||||
private static LoadingPanel _loadingPanel;
|
||||
|
||||
public static void SetProgress(float progress)
|
||||
{
|
||||
if (_loadingPanel != null)
|
||||
{
|
||||
_loadingPanel.Progress.value = progress * 100;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
ContentPane.sortingOrder = UIDef.UIOrder.Loading;
|
||||
_loadingPanel = this;
|
||||
Progress.max = 100;
|
||||
}
|
||||
|
||||
protected override void OnShow()
|
||||
|
||||
Reference in New Issue
Block a user