23 lines
497 B
C#
23 lines
497 B
C#
using System.Collections;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
public class MenuManager : MonoBehaviour
|
|
{
|
|
public void LoadScene(string sceneName)
|
|
{
|
|
StartCoroutine(LoadAsync(sceneName));
|
|
}
|
|
|
|
private IEnumerator LoadAsync(string sceneName)
|
|
{
|
|
AsyncOperation operation = SceneManager.LoadSceneAsync(sceneName);
|
|
|
|
while (!operation.isDone)
|
|
{
|
|
Debug.Log(operation.progress);
|
|
yield return null;
|
|
}
|
|
}
|
|
}
|