Steam Audio issue fixed, volume slider issue fixed
This commit is contained in:
@@ -17,6 +17,8 @@ public class AudioSliderDragHandler : MonoBehaviour, IBeginDragHandler, IDragHan
|
||||
private Vector2 backgroundStart;
|
||||
private float backgroundWidth;
|
||||
|
||||
public System.Action<float> OnValueChanged;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
handleRect = GetComponent<RectTransform>();
|
||||
@@ -80,6 +82,7 @@ public class AudioSliderDragHandler : MonoBehaviour, IBeginDragHandler, IDragHan
|
||||
CurrentValue = Mathf.Lerp(minValue, maxValue, normalized);
|
||||
|
||||
//Debug.Log(warningThreshholdValue);
|
||||
OnValueChanged?.Invoke(CurrentValue);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -17,8 +17,9 @@ public class SliderToVCA : MonoBehaviour
|
||||
private void Awake()
|
||||
{
|
||||
slider = GetComponent<AudioSliderDragHandler>();
|
||||
slider.OnValueChanged += ApplyVolume;
|
||||
}
|
||||
private void Start()
|
||||
private void Start()
|
||||
{
|
||||
float initialValue = GetInitialValueFromAudioManager();
|
||||
slider.SetHandlePosition(initialValue); // we will add this function
|
||||
@@ -40,7 +41,7 @@ private float GetInitialValueFromAudioManager()
|
||||
case VCATarget.UI:
|
||||
return AudioManager.Instance.UIVolume;
|
||||
default:
|
||||
return 1f;
|
||||
return 0.5f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user