private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); return; } else { _instance = this; } DontDestroyOnLoad(this.gameObject); GM.Instance.ingameCanvas = this; this.hideAllKeycards(); this.gameObject.SetActive(false); }
private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); return; } else { _instance = this; } if (transform.parent == null) { DontDestroyOnLoad(this); } SceneManager.sceneLoaded += OnSceneLoaded; if (ingameCanvas == null) { ingameCanvas = GameObject.FindObjectOfType <IngameCanvas>(); } }
// Use this for initialization void Awake() { ingamecanvas = this; }