유니티 Singleton 싱글톤 노트
private static GameManager instance = null; private void Awake() { if (null == instance) { instance = this; DontDestroyOnLoad(this.gameObject); } else { Destroy(this.gameObject); } } public static GameManager Instance { get { if (null == instance) { return null; } return instance; } }
Unity/C# note
2020. 12. 15. 22:26