private static GameManager _instance
public static GameManager Instance
{
get
{
// νϽ 쿡 Ϸ ϸ νϽ Ҵ+.
if (!_instance)
{
_instance = FindObjectOfType(typeof(GameManager)) as GameManager;
if (_instance == null)
Debug.Log("no Singleton obj");
}
return _instance;
}
}
private void Awake()
{
Paused = false;
if (_instance == null)
{
_instance = this;
}
else if (_instance != this)
{
Destroy(gameObject);
}
DontDestroyOnLoad(gameObject);
}
이걸로 게임오브젝트 파괴 안되게 만들었어요!!
public bool Check = false;
불 함수 만들고
버튼 누르면 씬 변경하는
public void SceneTr()
{
Check = true;
SceneManager.LoadScene("sceneT");
}
도 만들었어요.
근데 씬은 변경되는데 check는 true로 안 변해요ㅠㅠㅠ
어떻게 해야할까용 ㅠ
겜메니저 하나 더있는거 아니에요?
겜매니저 하나에요! 이벤트시스템이 씬마다 있는데 그거때문일까요?
static 으로 하니까 어거지로 되기는 하네요;;