Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable developer customers to access AudioSource at development time #436

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
AMollis marked this conversation as resolved.
Show resolved Hide resolved
david-c-kline marked this conversation as resolved.
Show resolved Hide resolved

/// <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