From da369d0d2352ea7f6f8c9aada41f558609764332 Mon Sep 17 00:00:00 2001 From: Pema Malling Date: Mon, 6 May 2024 18:37:31 +0200 Subject: [PATCH] Fix #299 by not firing UpdateSettings events when first reading the settings from AL -> Controller. --- .../Runtime/Scripts/AudioLinkController.cs | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/Packages/com.llealloo.audiolink/Runtime/Scripts/AudioLinkController.cs b/Packages/com.llealloo.audiolink/Runtime/Scripts/AudioLinkController.cs index 18464329..d4a58410 100644 --- a/Packages/com.llealloo.audiolink/Runtime/Scripts/AudioLinkController.cs +++ b/Packages/com.llealloo.audiolink/Runtime/Scripts/AudioLinkController.cs @@ -166,22 +166,34 @@ void Start() private void GetSettings() { // General settings - gainSlider.value = audioLink.gain; + gainSlider.SetValueWithoutNotify(audioLink.gain); + gainSlider.GetComponent().SlideUpdate(); //trebleSlider.value = audioLink.treble; //bassSlider.value = audioLink.bass; - fadeLengthSlider.value = audioLink.fadeLength; - fadeExpFalloffSlider.value = audioLink.fadeExpFalloff; - autoGainToggle.isOn = audioLink.autogain; + fadeLengthSlider.SetValueWithoutNotify(audioLink.fadeLength); + fadeLengthSlider.GetComponent().SlideUpdate(); + fadeExpFalloffSlider.SetValueWithoutNotify(audioLink.fadeExpFalloff); + fadeExpFalloffSlider.GetComponent().SlideUpdate(); + autoGainToggle.SetIsOnWithoutNotify(audioLink.autogain); + autoGainToggle.GetComponent().ToggleUpdate(); // Crossover Settings - x0Slider.value = audioLink.x0; - x1Slider.value = audioLink.x1; - x2Slider.value = audioLink.x2; - x3Slider.value = audioLink.x3; - threshold0Slider.value = audioLink.threshold0; - threshold1Slider.value = audioLink.threshold1; - threshold2Slider.value = audioLink.threshold2; - threshold3Slider.value = audioLink.threshold3; + x0Slider.SetValueWithoutNotify(audioLink.x0); + x0Slider.GetComponent().SlideUpdate(); + x1Slider.SetValueWithoutNotify(audioLink.x1); + x1Slider.GetComponent().SlideUpdate(); + x2Slider.SetValueWithoutNotify(audioLink.x2); + x2Slider.GetComponent().SlideUpdate(); + x3Slider.SetValueWithoutNotify(audioLink.x3); + x3Slider.GetComponent().SlideUpdate(); + threshold0Slider.SetValueWithoutNotify(audioLink.threshold0); + threshold0Slider.GetComponent().SlideUpdate(); + threshold1Slider.SetValueWithoutNotify(audioLink.threshold1); + threshold1Slider.GetComponent().SlideUpdate(); + threshold2Slider.SetValueWithoutNotify(audioLink.threshold2); + threshold2Slider.GetComponent().SlideUpdate(); + threshold3Slider.SetValueWithoutNotify(audioLink.threshold3); + threshold3Slider.GetComponent().SlideUpdate(); } public void UpdateSettings()