Cute_demon_attacks/meng_yao/Assets/script/JumpScene/Preloading.cs
2024-11-15 21:40:33 +08:00

50 lines
1.2 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public enum PerloadingScene
{
JINBIDAO,
BAOSHIDAO,
JINSHAKUANG,
BAOSHIKUANG
}
public class Preloading : MonoBehaviour
{
public static Preloading Instance;
private AsyncOperation JinshadaoSceneLoad;
private AsyncOperation baoshidaoSceneLoad;
// Start is called before the first frame update
void Start()
{
Instance = this;
JinshadaoSceneLoad = SceneManager.LoadSceneAsync(JumpScene.scene_jiashadao);
JinshadaoSceneLoad.allowSceneActivation = false;
baoshidaoSceneLoad = SceneManager.LoadSceneAsync(JumpScene.scene_baoshidao);
baoshidaoSceneLoad.allowSceneActivation = false;
}
public void OnSceneLoaded(PerloadingScene perloading)
{
switch(perloading)
{
case PerloadingScene.JINBIDAO:
JinshadaoSceneLoad.allowSceneActivation = true;
break;
case PerloadingScene.BAOSHIDAO:
baoshidaoSceneLoad.allowSceneActivation = true;
break;
}
}
// Update is called once per frame
void Update()
{
}
}