Example #1
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(this.gameObject);
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
Example #2
0
 private void Awake()
 {
     if (staticCanvas == null)
     {
         staticCanvas = this;
         DontDestroyOnLoad(this.gameObject);
         headingParent.localScale = Vector3.zero;
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
Example #3
0
 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();
     }
 }