UI update 02

This commit is contained in:
FloatGaming
2026-06-30 21:21:30 +08:00
parent b2a1e307a4
commit f62f643cfc
1666 changed files with 211081 additions and 22799 deletions
+27 -2
View File
@@ -2,6 +2,7 @@ using System.Collections;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using Bansonic;
public class BootLoader : MonoBehaviour
{
@@ -19,6 +20,8 @@ public class BootLoader : MonoBehaviour
[Tooltip("Optional Text to show loading percentage.")]
[SerializeField] private Text progressText;
private bool transitionStarted;
private void Start()
{
// Start the asynchronous loading process
@@ -61,8 +64,16 @@ public class BootLoader : MonoBehaviour
float elapsedTime = Time.time - startTime;
if (elapsedTime >= minSplashTime)
{
// Allow the scene to activate
asyncLoad.allowSceneActivation = true;
if (!transitionStarted)
{
transitionStarted = true;
if (gTransition.Run(AllowSceneActivationRoutine(asyncLoad)))
{
yield break;
}
asyncLoad.allowSceneActivation = true;
}
}
}
@@ -72,4 +83,18 @@ public class BootLoader : MonoBehaviour
// Restore screen sleep timeout
Screen.sleepTimeout = SleepTimeout.SystemSetting;
}
private IEnumerator AllowSceneActivationRoutine(AsyncOperation asyncLoad)
{
if (asyncLoad == null)
{
yield break;
}
asyncLoad.allowSceneActivation = true;
while (!asyncLoad.isDone)
{
yield return null;
}
}
}