diff --git a/Assets/Content/Scripts/MenuManager.cs b/Assets/Content/Scripts/MenuManager.cs new file mode 100644 index 0000000..9dd9415 --- /dev/null +++ b/Assets/Content/Scripts/MenuManager.cs @@ -0,0 +1,22 @@ +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; + } + } +}