Exemplo n.º 1
0
 void SetupSlider(SliderOption slider, string name, float?value)
 {
     if (slider.GetOption() == name && value != null)
     {
         float newX = (float)(value * (slider.GetRadius() * 2)) - slider.GetRadius() + slider.GetCenter();
         slider.GetComponent <RectTransform>().position = new Vector3(newX, slider.GetComponent <RectTransform>().position.y);
     }
 }
Exemplo n.º 2
0
    void GetSliderValue(SliderOption slider)
    {
        switch (slider.GetOption())
        {
        case "Master":
            Messenger.MS.SetMasterVolume(slider.GetValue());
            AudioListener.volume = (float)Messenger.MS.GetMasterVolume();
            break;

        case "Music":
            Messenger.MS.SetMusicVolume(slider.GetValue());
            AudioManager.AM.ChangeVolume(true, slider.GetValue());
            break;

        case "Sound":
            Messenger.MS.SetSoundVolume(slider.GetValue());
            AudioManager.AM.ChangeVolume(false, slider.GetValue());
            break;
        }
    }