Files
FallBots/Assets/Content/Scripts/MenuManager.cs
2026-03-18 13:24:26 +01:00

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;
}
}
}