42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UIElements;
|
|
using UnityEngine.InputSystem;
|
|
using BITKit;
|
|
using BITKit.UX;
|
|
using BITKit.Entities;
|
|
using BITKit.SceneManagement;
|
|
|
|
namespace BITFALL.UX
|
|
{
|
|
public class UXLoading : UIToolKitPanel
|
|
{
|
|
[Header(Constant.Header.Providers)]
|
|
[SerializeReference,SubclassSelector] private ISceneService sceneService;
|
|
[SerializeReference, SubclassSelector]
|
|
private INetProvider netProvider;
|
|
[Header(Constant.Header.Components)]
|
|
public UXBar loadBar;
|
|
public UXLabel loadText;
|
|
protected override void Awake()
|
|
{
|
|
base.Awake();
|
|
sceneService.OnLoadScene += Load;
|
|
sceneService.OnSceneLoadProgress += OnLoadProgress;
|
|
}
|
|
|
|
private void Load(string obj)
|
|
{
|
|
loadBar.SetDirect(0,$"正在开始加载:{obj}");
|
|
Entry();
|
|
}
|
|
|
|
private void OnLoadProgress(string s, float f)
|
|
{
|
|
loadBar.Set(f);
|
|
loadText.Set(s);
|
|
}
|
|
}
|
|
} |