Steam Audio issue fixed, volume slider issue fixed

This commit is contained in:
Timur Nizamov
2025-12-14 20:32:59 +02:00
parent 4bf99dd820
commit 252e7a2fa6
57 changed files with 13013 additions and 504 deletions

View File

@@ -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);
}

View File

@@ -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;
}
}