File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Assets/JCSUnity/Scripts/UI/Slider Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 88 */
99using UnityEngine ;
1010using UnityEngine . UI ;
11- using MyBox ;
1211
1312namespace JCSUnity
1413{
@@ -22,7 +21,7 @@ public class JCS_SoundSlider : MonoBehaviour
2221
2322 private Slider mSlider = null ;
2423
25- [ Separator ( " Initialize Variables (JCS_SoundSlider)") ]
24+ [ Header ( "** Initialize Variables (JCS_SoundSlider) ** ") ]
2625
2726 [ Tooltip ( "Sound type you would like the slider to control." ) ]
2827 [ SerializeField ]
@@ -42,7 +41,10 @@ private void Awake()
4241
4342 private void Update ( )
4443 {
45- JCS_SoundSettings . instance . SetSoudnVolume ( mSoundType , mSlider . value ) ;
44+ float total = mSlider . maxValue - mSlider . minValue ; // Find total.
45+ float val = mSlider . value / total ; // Convert to 0 to 1 scale.
46+
47+ JCS_SoundSettings . instance . SetSoudnVolume ( mSoundType , val ) ;
4648 }
4749 }
4850}
You can’t perform that action at this time.
0 commit comments