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