Add UnloadSceneAsync and SetActive to SceneReference
Deadcows opened this issue · 0 comments
Deadcows commented
Discussed in https://github.com/Deadcows/MyBox/discussions/200
Originally posted by St0wy June 15, 2022
It would be nice if the SceneReference
type had UnloadSceneAsync
and SetActive
methods.
I was able to have this functionnality by myself using extension methods :
public static AsyncOperation UnloadSceneAsync(this SceneReference sceneReference)
{
return SceneManager.UnloadSceneAsync(sceneReference.SceneName);
}
public static bool SetActive(this SceneReference sceneReference)
{
return SceneManager.SetActiveScene(SceneManager.GetSceneByName(sceneReference.SceneName));
}
But it would be nice if it was here by default.