mirror of
https://github.com/Bragin-Stepan/project-entity.git
synced 2026-03-05 07:41:10 +00:00
init: add project
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace Assets._Project.Develop.Runtime.Utilities.SceneManagement
|
||||
{
|
||||
public class SceneLoaderService
|
||||
{
|
||||
public IEnumerator LoadAsync(string sceneName, LoadSceneMode loadSceneMode = LoadSceneMode.Single)
|
||||
{
|
||||
AsyncOperation wait = SceneManager.LoadSceneAsync(sceneName, loadSceneMode);
|
||||
|
||||
yield return new WaitWhile(() => wait.isDone == false);
|
||||
}
|
||||
|
||||
public IEnumerator UnloadAsync(string sceneName)
|
||||
{
|
||||
AsyncOperation wait = SceneManager.UnloadSceneAsync(sceneName);
|
||||
|
||||
yield return new WaitWhile(() => wait.isDone == false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user