씬 전환을 위한 씬매니저 추가 및 씬 전환 기능 추가
This commit is contained in:
@@ -7,9 +7,11 @@ public class Managers : MonoBehaviour
|
||||
|
||||
InputManager _input = new InputManager();
|
||||
ResourceManager _resource = new ResourceManager();
|
||||
SceneManagerEx _scene = new SceneManagerEx();
|
||||
UIManager _ui = new UIManager();
|
||||
public static InputManager Input { get { return Instance._input; } }
|
||||
public static ResourceManager Resource { get { return Instance._resource; } }
|
||||
public static SceneManagerEx Scene { get { return Instance._scene; } }
|
||||
public static UIManager UI { get { return Instance._ui; } }
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Managers/SceneManagerEx.cs.meta
Normal file
2
Assets/Scripts/Managers/SceneManagerEx.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0c0749fe13086e04389ab99ece6ff556
|
||||
Reference in New Issue
Block a user