feat: add BootStatusUIView for loading progress display with text feedback
- 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
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace QuizPleaseTest.Boot.UI
|
||||
{
|
||||
public class BootStatusUIView : MonoBehaviour
|
||||
{
|
||||
[field: SerializeField] public TMP_Text StatusText { get; private set; }
|
||||
[field: SerializeField] public Slider ProgressSlider { get; private set; }
|
||||
|
||||
public void SetStatus(string status)
|
||||
{
|
||||
if (StatusText == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
StatusText.text = status;
|
||||
}
|
||||
|
||||
public void SetProgress(float progress)
|
||||
{
|
||||
if (ProgressSlider == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ProgressSlider.value = Mathf.Clamp01(progress);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a7777777777777777777777777777777
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,12 +1,13 @@
|
||||
using QuizPleaseTest.Common.UI;
|
||||
using UniRx;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace QuizPleaseTest.Boot.UI
|
||||
{
|
||||
public class LoadingUIView : UIView<LoadingUIViewModel>
|
||||
{
|
||||
[field: SerializeField] public Transform ProgressFill { get; private set; }
|
||||
[field: SerializeField] public Slider ProgressSlider { get; private set; }
|
||||
|
||||
private CompositeDisposable _disposables;
|
||||
|
||||
@@ -32,14 +33,12 @@ namespace QuizPleaseTest.Boot.UI
|
||||
|
||||
private void SetProgress(float progress)
|
||||
{
|
||||
if (ProgressFill == null)
|
||||
if (ProgressSlider == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Vector3 scale = ProgressFill.localScale;
|
||||
scale.x = Mathf.Clamp01(progress);
|
||||
ProgressFill.localScale = scale;
|
||||
ProgressSlider.value = Mathf.Clamp01(progress);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user