Files
TopDownRPG/Assets/02_Scripts/Managers/GameManager.cs
2026-09-24 00:30:35 +09:00

24 lines
569 B
C#

using UnityEngine;
public class GameManager : MonoBehaviour,ISceneInitializable
{
public static GameManager Instance { get; private set; }
private void Awake()
{
if (Instance == null)
{
Instance = this; //만들어진 자신을 인스턴스로 설정
DontDestroyOnLoad(gameObject); //씬이 바뀌어도 파괴되지 않도록 설정
}
else
{
Destroy(gameObject); //이미 인스턴스가 있으면 자신을 파괴
}
}
public void OnSceneLoaded()
{
}
}