Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.M))
        {
            mixer.ClearFloat("MasterVolume");
            muteSnapshot.TransitionTo(.5f);
        }
        else if (Input.GetKeyDown(KeyCode.LeftShift))
        {
            mixer.ClearFloat("MasterVolume");
            normalSnapshot.TransitionTo(.5f);
        }

        /*
         * else if(Input.GetMouseButton(0))
         * {
         *  float currentVolume;
         *  mixer.GetFloat("MasterVolume", out currentVolume);
         *  mixer.SetFloat("MasterVolume", currentVolume + .1f);
         * }
         */
        else if (Input.GetMouseButton(1))
        {
            float currentVolume;
            mixer.GetFloat("MasterVolume", out currentVolume);
            mixer.SetFloat("MasterVolume", currentVolume - .1f);
        }
    }
Exemplo n.º 2
0
 public void LoadMenu()
 {
     GameIsUnpaused();
     masterAudioMixer.ClearFloat("MusicVolume");
     masterAudioMixer.ClearFloat("SFXVolume");
     //StartCoroutine(DelaySceneLoad(0));
     SceneManager.LoadScene(0);
 }
 public void ClearValues()
 {
     mixer.ClearFloat("WetmixFlange");
     wetmixStatus.text = "_";
     mixer.ClearFloat("DrymixFlange");
     drymixStatus.text = "_";
     mixer.ClearFloat("BangVolume");
     bangVolumeStatus.text = "_";
 }
Exemplo n.º 4
0
 private void OnTriggerExit2D(Collider2D collision)
 {
     if (collision.gameObject.CompareTag("Player"))
     {
         isActive = false;
         masterMixer.ClearFloat("backgroundVolume");
         masterMixer.ClearFloat("gameplayNotesVolume");
         audioSource.Stop();
     }
 }
Exemplo n.º 5
0
 // TODO: move to UI Manager
 public void ToggleMusic(bool _sound)
 {
     if (_sound)
     {
         soundMixer.ClearFloat("backgroundVolume");
     }
     else
     {
         soundMixer.SetFloat("backgroundVolume", -80f);
     }
 }
Exemplo n.º 6
0
    public void MusicMuted(float _MusicVol)
    {
        Singleton.instance.MusicMuted = true;

        if (Singleton.instance.MusicMuted)
        {
            masterMixer.SetFloat("musicVolume", _MusicVol);
        }

        if (musicToggle.isOn == false)
        {
            Singleton.instance.MusicMuted = false;
            masterMixer.ClearFloat("musicVolume");
        }
    }
Exemplo n.º 7
0
 public void Clear()
 {
     if (audioMixer)
     {
         audioMixer.ClearFloat(exposedParameter);
     }
 }
Exemplo n.º 8
0
 //----------------------------------------------------------
 // アウェイク
 //
 private void Initialize()
 {
     depth = 0.0f;
     myAudioMixer.SetFloat("bgm_Chorus_Depth", depth);
     myAudioMixer.ClearFloat("bgm_Chorus_Wet");
     initFlg = false;
 }
Exemplo n.º 9
0
 void OnDestroy()
 {
     foreach (string key in currentParameterBools.Keys)
     {
         mainMixer.ClearFloat(key);
     }
 }
Exemplo n.º 10
0
        // Change this to return true or false
        public static void ResetDecibels(AudioChannelIndex index)
        {
            AudioMixer mixer   = index.MixerIndex.Data.Mixer;
            bool       success = mixer.ClearFloat(GetVolumeParameterName(index));

            if (!success)
            {
                Debug.LogWarning(GetMissingParameterWarning(index));
            }
        }
Exemplo n.º 11
0
        private IEnumerator TransitionThroughTube(byte target)
        {
            string targetName = portNameConnections[target];


            bool currentMovingDirectionIsForward = StartingMovingDirectionIsForward;
            PorterPipeSection currentSection     = startingSection;
            PorterPipeSection nextSection;

            player.GetComponent <PlayerDeactivationHandler>().Dectivate();
            mixer.SetFloat("MasterLowPass", 0);
            mixer.SetFloat("MasterPitch", 0.5f);
            mixer.SetFloat("MasterEcho", 0);

            while (ShouldContinue(currentSection, targetName))
            {
                nextSection = currentSection.GetNextSection(currentMovingDirectionIsForward);

                if (nextSection.IsBlocked())
                {
                    currentMovingDirectionIsForward = !currentMovingDirectionIsForward;
                    nextSection = currentSection.GetNextSection(currentMovingDirectionIsForward);
                }


                float t = 0;
                while (t < 1)
                {
                    player.transform.position = Vector3.Lerp(currentSection.transform.position, nextSection.transform.position, t);
                    yield return(null);

                    t += Time.deltaTime * speed;
                }

                currentSection = nextSection;
            }

            player.transform.position = currentSection.GetComponent <PorterPipeEntrance>().arrivingPosition;
            player.GetComponent <PlayerDeactivationHandler>().Activate();
            mixer.ClearFloat("MasterLowPass");
            mixer.ClearFloat("MasterPitch");
            mixer.ClearFloat("MasterEcho");
        }
Exemplo n.º 12
0
    //!Change volume for groups in MasterMixer, handles volume levels of 1-100 converts to dB level for mixer
    public void changeVol(string name, float level)
    {
        if (masterMixer == null)
        {
            return;
        }
        level = level - 80f;            //done so that vol at 50% will actually be 50% of total volume
        switch (name.ToLower())
        {
        case "master":
            masterMixer.SetFloat("MasterVol", level);
            break;

        case "ambience":
            masterMixer.SetFloat("MaxambienceVol", level);
            break;

        case "effect":
            masterMixer.SetFloat("MaxEffectVol", level);
            break;

        case "music":
            masterMixer.SetFloat("MaxMusicVol", level);
            break;

        case "voice":
            masterMixer.SetFloat("MaxVoiceVol", level);
            break;

        case "reset":
            masterMixer.ClearFloat("MasterVol");
            masterMixer.ClearFloat("MaxambienceVol");
            masterMixer.ClearFloat("MaxEffectVol");
            masterMixer.ClearFloat("MaxMusicVol");
            masterMixer.ClearFloat("MaxVoiceVol");
            editorVol = 60f;
            break;

        default:
            Debug.Log("audio", name + "is not an option, or you spelled it wrong");
            break;
        }
    }
Exemplo n.º 13
0
 public void clearMixer()
 {
     for (var i = 0; i < arrAudio.Length; i++)
     {
         masterMixer.ClearFloat(arrAudio [i]);
         masterMixer.SetFloat(arrAudio[i], 0);
         slider_Master.value   = 0;
         slider_Music.value    = 0;
         slider_Ambiance.value = 0;
         slider_Voice.value    = 0;
         slider_Fx.value       = 0;
     }
     saveVolumes();
 }
Exemplo n.º 14
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            mixer.ClearFloat("MasterVolume");
            lowVolumeSnapshot.TransitionTo(0.5f);
        }

        if (Input.GetMouseButton(0))
        {
            float currentVolume;
            mixer.GetFloat("MasterVolume", out currentVolume);

            mixer.SetFloat("MasterVolume", currentVolume + .1f);
        }
    }
Exemplo n.º 15
0
 public void ClearDistordion()
 {
     audioMixer.ClearFloat("");
 }
Exemplo n.º 16
0
 private void ClearVolume()
 {
     m_masterMixer.ClearFloat("musicTrackVolume");
 }
Exemplo n.º 17
0
 // Resets the mixer group to its default volume.
 public void DefaultVolume()
 {
     // ClearFloat reverts the changes in mixerParameter to its default.
     mixer.ClearFloat(mixerParameter);
 }
 public void Clear()
 {
     m_mixer.ClearFloat(m_parameterName);
 }
Exemplo n.º 19
0
 public void ClearVolume()
 {
     masterMixer.ClearFloat("musicVol");
 }
Exemplo n.º 20
0
 public void ResetExposedParam(string name)
 {
     mixer.ClearFloat(name);
 }
Exemplo n.º 21
0
 public void ClearVolume(string name)
 {
     _mixer.ClearFloat(name);
 }
Exemplo n.º 22
0
 /// <summary>
 /// Clear the master volume of the audio mixer. This is useful for audio snapshots.
 /// </summary>
 public void ClearMasterVolume()
 {
     mixer.ClearFloat("masterVolume");
 }
 public void ClearVolume()
 {
     musicAudioMixer.ClearFloat("mastervolume");
 }
Exemplo n.º 24
0
 void Controls()
 {
     if (Input.GetButtonDown("A"))
     {
         masterMixer.GetFloat("VoxVol", out lvl);
         if (lvl == -80f)
         {
             masterMixer.ClearFloat("VoxVol");
             voxIntensityTarget = 5f;
         }
         else
         {
             masterMixer.SetFloat("VoxVol", -80f);
             voxIntensityTarget = 0f;
         }
     }
     if (Input.GetButtonDown("Y"))
     {
         masterMixer.GetFloat("DrumsVol", out lvl);
         if (lvl == -80f)
         {
             masterMixer.ClearFloat("DrumsVol");
             drumsIntensityTarget = 5f;
         }
         else
         {
             masterMixer.SetFloat("DrumsVol", -80f);
             drumsIntensityTarget = 0f;
         }
     }
     if (Input.GetButtonDown("B"))
     {
         masterMixer.GetFloat("GuitarVol", out lvl);
         if (lvl == -80f)
         {
             masterMixer.ClearFloat("GuitarVol");
             guitarIntensityTarget = 5f;
         }
         else
         {
             masterMixer.SetFloat("GuitarVol", -80f);
             guitarIntensityTarget = 0f;
         }
     }
     if (Input.GetButtonDown("X"))
     {
         masterMixer.GetFloat("AcousticVol", out lvl);
         if (lvl == -80f)
         {
             masterMixer.ClearFloat("AcousticVol");
             acousticIntensityTarget = 5f;
         }
         else
         {
             masterMixer.SetFloat("AcousticVol", -80f);
             acousticIntensityTarget = 0f;
         }
     }
     if (Input.GetButtonDown("R"))
     {
         if (currentCam < cameras.Length - 1)
         {
             currentCam += 1;
         }
         else
         {
             currentCam = 0;
         }
         SwapCamera(currentCam);
     }
     if (Input.GetButtonDown("L"))
     {
         if (currentCam > 0)
         {
             currentCam -= 1;
         }
         else
         {
             currentCam = cameras.Length - 1;
         }
         SwapCamera(currentCam);
     }
 }