Skip to content

Commit

Permalink
Enable developer customers to access AudioSource at development time (#…
Browse files Browse the repository at this point in the history
…436)

* Enable developer customers to access AudioSource at development time

* pr feedback: add public accessors

---------

Co-authored-by: Kline, Dave (David Kline) <[email protected]>
  • Loading branch information
david-c-kline and Kline, Dave (David Kline) authored Aug 23, 2023
1 parent 770b1c4 commit 1d61251
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions org.mixedrealitytoolkit.uxcore/Slider/SliderSounds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,31 @@ public class SliderSounds : MonoBehaviour
/// </summary>
public float MinSecondsBetweenTicks { get => minSecondsBetweenTicks; set => minSecondsBetweenTicks = value; }

[SerializeField]
[Tooltip("The source of the grab and release sounds")]
private AudioSource grabReleaseAudioSource = null;

/// <summary>
/// Gets or sets the AudioSource used to play grab and release sounds.
/// </summary>
public AudioSource GrabReleaseAudioSource
{
get => grabReleaseAudioSource;
set => grabReleaseAudioSource = value;
}

[SerializeField]
[Tooltip("The source of the pass notch sounds")]
private AudioSource passNotchAudioSource = null;

/// <summary>
/// Gets or sets the AudioSource used to play sound when the user moves the slider thumb past a notch.
/// </summary>
public AudioSource PassNotchAudioSource
{
get => passNotchAudioSource;
set => passNotchAudioSource = value;
}

#region Private members
private Slider slider;
Expand All @@ -119,9 +144,6 @@ public class SliderSounds : MonoBehaviour
// Play sound when passing through slider notches
private float accumulatedDeltaSliderValue = 0;
private float lastSoundPlayTime;

private AudioSource grabReleaseAudioSource = null;
private AudioSource passNotchAudioSource = null;
#endregion

/// <summary>
Expand Down

0 comments on commit 1d61251

Please sign in to comment.