134e38c57c
- Create new BootStatusUIView MonoBehaviour component with StatusText and ProgressSlider fields - Implement SetStatus() and SetProgress() methods for updating UI elements - Replace Transform-based ProgressFill in LoadingUIView with Slider component for better UX - Integrate BootStatusUIView into LoadState with real-time status updates during loading steps - Display formatted progress text (e.g., 'Loading 50%') alongside slider updates - Add SceneTemplateSettings.json to ProjectSettings for scene template configuration
45 lines
1.0 KiB
C#
45 lines
1.0 KiB
C#
using QuizPleaseTest.Common.UI;
|
|
using UniRx;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace QuizPleaseTest.Boot.UI
|
|
{
|
|
public class LoadingUIView : UIView<LoadingUIViewModel>
|
|
{
|
|
[field: SerializeField] public Slider ProgressSlider { get; private set; }
|
|
|
|
private CompositeDisposable _disposables;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
_disposables?.Dispose();
|
|
_disposables = new CompositeDisposable();
|
|
|
|
SetProgress(ViewModel.Progress.Value);
|
|
ViewModel.Progress
|
|
.Subscribe(SetProgress)
|
|
.AddTo(_disposables);
|
|
}
|
|
|
|
public override void Release()
|
|
{
|
|
_disposables?.Dispose();
|
|
_disposables = null;
|
|
base.Release();
|
|
}
|
|
|
|
private void SetProgress(float progress)
|
|
{
|
|
if (ProgressSlider == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
ProgressSlider.value = Mathf.Clamp01(progress);
|
|
}
|
|
}
|
|
}
|