MenuManager
This commit is contained in:
22
Assets/Content/Scripts/MenuManager.cs
Normal file
22
Assets/Content/Scripts/MenuManager.cs
Normal file
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user