Esempio n. 1
0
 void Awake()
 {
     if (ControlSonido.instance == null)
     {
         ControlSonido.instance = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(this.gameObject);
         if (!musica_sonando)
         {
             iniciarMusicaAmbiente();
             musica_sonando = true;
         }
     }
     else
     {
         Destroy(this.gameObject);
     }
 }    // fin de start