Initial commit

This commit is contained in:
MuHua-123
2024-11-01 17:14:31 +08:00
commit 5f169b90bb
216 changed files with 24712 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using MuHua;
public class SceneLoader : ModuleScene {
public Slider progressBar;
public override IEnumerator ILoadSceneAsync(string scene) {
int disableProgress = 0;
int toProgress = 0;
AsyncOperation ao = SceneManager.LoadSceneAsync(scene);
ao.allowSceneActivation = false;
transform.SonActive(true);
while (ao.progress < 0.9f) {
toProgress = (int)(ao.progress * 100);
while (disableProgress < toProgress) {
++disableProgress;
progressBar.value = disableProgress / 100.0f;//0.01开始
yield return new WaitForEndOfFrame();
}
}
toProgress = 100;
while (disableProgress < toProgress) {
++disableProgress;
progressBar.value = disableProgress / 100.0f;
yield return new WaitForEndOfFrame();
}
ao.allowSceneActivation = true;
while (!ao.isDone) {
yield return new WaitForEndOfFrame();
}
transform.SonActive(false);
}
}