This commit is contained in:
JA
2026-06-20 19:34:23 +08:00
parent e5031c0068
commit d442805c3f
4136 changed files with 514641 additions and 0 deletions

View File

@@ -0,0 +1,72 @@
using Manager;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class UILoad : MonoBehaviour
{
public Slider progressBar;
public Text progressText;
private IEnumerator Start()
{
Scene scene = UnityEngine.SceneManagement.SceneManager.GetActiveScene();
for (float i = 0; i < 100;)
{
i += Random.Range(0.1f, 1.5f);
progressBar.value = i;
if (i > 100)
{
progressText.text = "99%";
}
else
{
progressText.text = i + "%";
}
yield return new WaitForEndOfFrame();
}
yield return new WaitForSeconds(1f);
if (scene.buildIndex == 1)
{
if (!PlayerInfo.Instance.info.BagInfo.ContainsKey(1))
{
PlayerInfo.Instance.info.BagInfo.Add(1, 4);
}
}
if(scene.buildIndex==3)
{
UIManager.Instance.Show<EndUI>();
}
else
{
Manager.SenceManager.Instance.LoadScene(scene.buildIndex + 1);
CheckMusic(scene.buildIndex + 1);
Destroy(this.gameObject, 2f);
}
}
private void CheckMusic(int idx)
{
switch (idx)
{
case 1:
SoundManager.Instance.PlayMusic(SoundDefine.Map_1Music);
break;
case 2:
SoundManager.Instance.PlayMusic(SoundDefine.Map_2Music);
break;
case 3:
SoundManager.Instance.PlayMusic(SoundDefine.Map_3Music);
break;
}
}
}