Ejemplo n.º 1
0
 private void OnDestroy()
 {
     if (SistemaAudio.instance != this)
     {
         SistemaAudio.instance = null;
     }
 }
Ejemplo n.º 2
0
    // Use this for initialization

    private void Awake()
    {
        if (SistemaAudio.instance == null)
        {
            SistemaAudio.instance = this;
        }
        else if (SistemaAudio.instance != this)
        {
            Destroy(gameObject);
        }
    }