예제 #1
0
    void Awake()
    {
        if (masteraudio_control == null)
        {
            masteraudio_control = this;
        }
        else if (masteraudio_control != this)
        {
            Destroy(gameObject);
        }
        DontDestroyOnLoad(masteraudio_control);

        foreach (sonido s in sonidos)
        {
            s.source              = gameObject.AddComponent <AudioSource>();
            s.source.clip         = s.clip;
            s.source.volume       = s.volumen;
            s.source.pitch        = s.pitch;
            s.source.loop         = s.loop;
            s.source.spatialBlend = s.spatBlend;
            if (s.spatBlend == 1)
            {
                s.source.rolloffMode = AudioRolloffMode.Linear;
            }
            s.source.maxDistance = s.max_distance;
        }

        ////////////////
        int musica_int = PlayerPrefs.GetInt("musica", 1);

        if (musica_int == 1)
        {
            estadomusica = true;
        }
        else
        {
            if (musica_int == 0)
            {
                estadomusica = false;
            }
        }
        int sonido_int = PlayerPrefs.GetInt("sonido", 1);

        if (sonido_int == 1)
        {
            estadosonido = true;
        }
        else
        {
            if (sonido_int == 0)
            {
                estadosonido = false;
            }
        }
    }
예제 #2
0
    ////////START///////
    void Start()
    {
        audiocontroller_aux = FindObjectOfType <audiocontroller>();
        adlocal             = GetComponent <Adcaller>();
        cambiador_fades     = FindObjectOfType <changer_fades>();

        //Componenetes Iniciales del juego
        puntos_encript = gameObject.AddComponent(typeof(puntitoscrip)) as puntitoscrip;
        vidas_encript  = gameObject.AddComponent(typeof(vidasscrip)) as vidasscrip;

        StartCoroutine(Menu());
    }
예제 #3
0
 void Start()
 {
     audiocontroller_aux = FindObjectOfType <audiocontroller>();
     if (sonido_reproducir != null && audiocontroller_aux != null)
     {
         audiocontroller_aux.reproducir(sonido_reproducir);
     }
     else
     {
         Debug.Log("Es nulo sonido para portal");
     }
 }
예제 #4
0
 void Start()
 {
     gamecontroller_aux  = FindObjectOfType <GameController>();
     audiocontroller_aux = FindObjectOfType <audiocontroller>();
     fade_aux            = FindObjectOfType <changer_fades>();
 }
 void Start()
 {
     audiocontroller_aux = FindObjectOfType <audiocontroller>();
 }
예제 #6
0
 void Start()
 {
     gamecontroller_aux  = FindObjectOfType <GameController>();
     audiocontroller_aux = FindObjectOfType <audiocontroller>();
 }
 // Start is called before the first frame update
 void Start()
 {
     audiocontroller_aux = FindObjectOfType <audiocontroller>();
     control_uno         = true;
 }