static Managers s_instance; // 유일성을 보장한다
static Managers Instance { get { Init(); return s_instance; } } // 프로퍼티로 Managers를 불러오기 용이함
InputManager _input = new InputManager();
public static InputManager Input { get { return Instance._input; } }
void Start()
{
Init();
}
void Update()
{
}
static void Init()
{
if (s_instance == null)
{
GameObject go = GameObject.Find("@Manager");
if (go == null)
{
go = new GameObject { name = ("@Manager") };
go.AddComponent<Managers>();
}
DontDestroyOnLoad(go);
s_instance = go.GetComponent<Managers>();
}
}