protected void OnDestroy() { if (m_Instance.Equals(this)) { m_Instance = null; } }
protected void Awake() { // Prevent multiple if (m_Instance != null) { Destroy(this.gameObject); return; } m_Instance = this; DontDestroyOnLoad(this.gameObject); if (this.m_Raycaster == null) { this.m_Raycaster = this.gameObject.GetComponent <GraphicRaycaster>(); } if (this.m_Raycaster != null) { this.m_Raycaster.enabled = false; } }