씬 전환을 위한 씬매니저 추가 및 씬 전환 기능 추가
This commit is contained in:
20
Assets/Scripts/Managers/SceneManagerEx.cs
Normal file
20
Assets/Scripts/Managers/SceneManagerEx.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class SceneManagerEx
|
||||
{
|
||||
public BaseScene CurrentScene { get { return GameObject.FindAnyObjectByType<BaseScene>(); } }
|
||||
|
||||
public void LoadScene(Define.Scene type)
|
||||
{
|
||||
CurrentScene.Clear();
|
||||
SceneManager.LoadScene(GetSceneName(type));
|
||||
}
|
||||
|
||||
string GetSceneName(Define.Scene type)
|
||||
{
|
||||
string name = System.Enum.GetName(typeof(Define.Scene), type);
|
||||
|
||||
return name;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user