void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(this.gameObject); } else { Destroy(this.gameObject); } }
private void Awake() { if (staticCanvas == null) { staticCanvas = this; DontDestroyOnLoad(this.gameObject); headingParent.localScale = Vector3.zero; } else { Destroy(this.gameObject); } }
void OnSceneLoaded(Scene scene, LoadSceneMode mode) { if (SceneManager.GetActiveScene().name == "MenuPrincipal") { PersistantCanvas.instance = null; DialogueManager.instance = null; MissionManager.instance = null; MessageManager.instance = null; EntranceManager.instance = null; Destroy(this.gameObject); } else { UpdateCanvasObjects(); try { GameManager.instance.UpdateExamsRender(); } catch { Debug.Log("HUDMaganer gameobject desactivado en la jeranquÃa"); } MessageManager.instance.CloseMessage(); } }