FMOD.Studio.EventInstance.setVolume C# (CSharp) Method

setVolume() public method

public setVolume ( float volume ) : RESULT
volume float
return RESULT
        public RESULT setVolume(float volume)
        {
            return FMOD_Studio_EventInstance_SetVolume(rawPtr, volume);
        }
        public RESULT getPitch(out float pitch)

Usage Example

    void OnTriggerEnter(Collider other)
    {
        if(other.gameObject.tag == "Parede3")
        {
            temp++;
            contador = 1;
            StartCoroutine("GO");
        }

        if (other.gameObject.tag == "Enemy")
        {
            if (other.gameObject.GetComponent<EnemyController>().life > 0 && other.gameObject.GetComponent<EnemyController>().dano)
            {
                vol = FMODUnity.RuntimeManager.CreateInstance(dano);
                vol.setVolume(PlayerPrefs.GetFloat("VolumeFX"));
                vol.start();
                Dano(other.gameObject);
            }
        }
        else if (other.gameObject.tag == "EnemyRanged")
        {
            if (other.gameObject.GetComponent<EnemyRanged>().life > 0 && other.gameObject.GetComponent<EnemyRanged>().dano)
            {
                vol = FMODUnity.RuntimeManager.CreateInstance(dano);
                vol.setVolume(PlayerPrefs.GetFloat("VolumeFX"));
                vol.start();
                Dano(other.gameObject);
            }
        }
    }
All Usage Examples Of FMOD.Studio.EventInstance::setVolume
EventInstance