Beispiel #1
0
    public void SetVolumeMusic(float vol)
    {
        string vcaPath = "vca:/MusicVCA";

        FMOD.Studio.VCA vca = FMODUnity.RuntimeManager.GetVCA(vcaPath);
        vca.setVolume(vol);
    }
Beispiel #2
0
    // função para controlar volume do SFX no jogo (volume min=0 max=1)
    void VolumeUI_MUSIC(float volume)
    {
        string vcaPath = "vca:/ui music";

        FMOD.Studio.VCA vca = FMODUnity.RuntimeManager.GetVCA(vcaPath);
        vca.setVolume(volume);
    }
Beispiel #3
0
    // função para controlar volume da UI (volume min=0 max=1)
    void VolumeSFX(float volume)
    {
        string vcaPath = "vca:/sfx";

        FMOD.Studio.VCA vca = FMODUnity.RuntimeManager.GetVCA(vcaPath);
        vca.setVolume(volume);
    }
Beispiel #4
0
    //---------------------------------------
    // good to know: linear-> db conversion
    // float db = linear > 0 ? 20.0f * Mathf.Log10(linear * Mathf.Sqrt(2.0f)) : -80.0f;
    //
    public void SetVolumeFx(float vol)
    {
        //  Debug.Log("vol: " + vol);
        string vcaPath = "vca:/FXVCA";

        FMOD.Studio.VCA vca = FMODUnity.RuntimeManager.GetVCA(vcaPath);
        vca.setVolume(vol);
    }
Beispiel #5
0
    // Update is called once per frame
    void Update()
    {
        // Test event
        if (Input.GetKeyDown(KeyCode.Alpha9))
        {
            FMODUnity.RuntimeManager.PlayOneShot(TestEventName, this.transform.position);
        }

        // Volume control
        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            sfx_volume = Mathf.Clamp(sfx_volume - 0.1f, 0.0f, 1.0f);
            VCA_SFX.setVolume(sfx_volume);
            VCA_Music.setVolume(sfx_volume);
        }
        if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            sfx_volume = Mathf.Clamp(sfx_volume + 0.1f, 0.0f, 1.0f);
            VCA_SFX.setVolume(sfx_volume);
            VCA_Music.setVolume(sfx_volume);
        }
    }
Beispiel #6
0
 public void MusicVolume(float val)
 {
     vca_mus.setVolume(val);
     PlayerPrefs.SetFloat("MusicVolume", val);
 }
    public void SetFXVolume(float volume)
    {
        volumeFX = volume;

        FXVCA.setVolume(volume);
    }
    public void SetMusicVolume(float volume)
    {
        volumeMusik = volume;

        MusicVCA.setVolume(volume);
    }
Beispiel #9
0
 public void SetVoVolume(float volume)
 {
     voVca.setVolume(volume);
 }
Beispiel #10
0
 public void SetAtVolume(float volume)
 {
     atVca.setVolume(volume);
 }
Beispiel #11
0
    /// <summary>
    /// Мы можем менять громкость каждый фрейм, но правельнее будет менять громкость только в случае ее изменения (функцию ValueChange)
    /// </summary>
    ///

    //void Update()
    //{
    //    vcaController.getVolume(out vcaVolume);
    //    vcaController.setVolume(ourSlider.value);
    //}

    public void VCAVolumeChange()                 // Создаем новую функцию, которую нужно обязательно подключить в компоненте слайдера On Value Changed
    {
        vcaController.setVolume(ourSlider.value); // устанавливаем громкость шины VCA в такое же значение, как значение нашего слайдера
    }
Beispiel #12
0
 public void SetMuVolume(float volume)
 {
     muVca.setVolume(volume);
 }
Beispiel #13
0
 public void SetMainVolume(float volume)
 {
     mainVca.setVolume(volume);
 }
Beispiel #14
0
 void Update()
 {
     volume = Mathf.Pow(10.0f, vcaVolume / 20f);
     vca.setVolume(volume);
 }
Beispiel #15
0
 public void SFXVolume(float val)
 {
     vca_sfx.setVolume(val);
     PlayerPrefs.SetFloat("SFXVolume", val);
 }
Beispiel #16
0
 public void SetSxVolume(float volume)
 {
     sxVca.setVolume(volume);
 }
Beispiel #17
0
    // Start is called before the first frame update
    void Start()
    {
        vca_mus = FMODUnity.RuntimeManager.GetVCA("vca:/Music");
        vca_sfx = FMODUnity.RuntimeManager.GetVCA("vca:/SFX");

        //Load volume settings
        if (PlayerPrefs.HasKey("MusicVolume"))
        {
            vca_mus.setVolume(PlayerPrefs.GetFloat("MusicVolume"));
        }
        else
        {
            vca_mus.setVolume(1.0f);
        }
        if (PlayerPrefs.HasKey("SFXVolume"))
        {
            vca_sfx.setVolume(PlayerPrefs.GetFloat("SFXVolume"));
        }
        else
        {
            vca_sfx.setVolume(1.0f);
        }

        //Load Mouse settings
        if (PlayerPrefs.HasKey("MouseAcceleration"))
        {
            PlayerCameraController.SetMouseAccel(PlayerPrefs.GetInt("MouseAcceleration") == 1);
        }
        if (PlayerPrefs.HasKey("MouseSensitivity"))
        {
            PlayerCameraController.SetMouseSens(PlayerPrefs.GetFloat("MouseSensitivity"));
        }

        GameObject pausePanelObj = GameObject.Find("PauseMenu");

        if (pausePanelObj != null)
        {
            pausePanel = pausePanelObj.GetComponent <CanvasGroup>();
        }

        GameObject hudObj = GameObject.Find("HUD");

        if (hudObj != null)
        {
            hud = hudObj.GetComponent <CanvasGroup>();
        }

        pauseOpen = false;

        curMenu = hud;

        if (!isMainMenu)
        {
            Cursor.visible   = false;
            Cursor.lockState = CursorLockMode.Locked;
        }
        else
        {
            Cursor.visible   = true;
            Cursor.lockState = CursorLockMode.None;
        }
    }
Beispiel #18
0
 private void SetVcaVolumes()
 {
     musicVCA.setVolume(dBtoLinear(musicVolume));
     sfxVCA.setVolume(dBtoLinear(sfxVolume));
 }