void OnSceneLoaded(Scene scene, LoadSceneMode mode) { if (SceneManager.GetActiveScene().name == "MenuPrincipal") { Destroy(this.gameObject); PersistantCharacter.instance = null; } else { UpdateShops(); UpdateNPCs(); GameManager.instance.MuevePersonajes(); } }
void Awake() { if (instance == null) { instance = this; npcs = GetComponentsInChildren <NPC> (); DontDestroyOnLoad(this.gameObject); UpdateShops(); } else { Destroy(this.gameObject); } }