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 } }
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 } }
private void Awake() { if (soundSystem.instance == null) { soundSystem.instance = this; } else if (soundSystem.instance != this) { Destroy(gameObject); } }
private void OnDestroy() { soundSystem.instance = null; }