示例#1
0
 private void OnDestroy()              //funcion destruir sonido creado
 {
     if (soundSystem.instance == this) //si el sonido es igual al que sono
     {
         soundSystem.instance = null;  //sound va a ser igual a vacio
     }
 }
示例#2
0
 private void Awake()
 {
     if (soundSystem.instance == null)      //si la variable sonidoSystem es igual a vacio
     {
         soundSystem.instance = this;       //crear una instancia
     }
     else if (soundSystem.instance != this) //sino es esta creada
     {
         Destroy(gameObject);               //destruir el game object del sonido
     }
 }
示例#3
0
 private void Awake()
 {
     if (soundSystem.instance == null)
     {
         soundSystem.instance = this;
     }
     else if (soundSystem.instance != this)
     {
         Destroy(gameObject);
     }
 }
示例#4
0
 private void OnDestroy()
 {
     soundSystem.instance = null;
 }