Class DropdownAudioHandler
- Namespace
- Fallencake.UI.Audio
- Assembly
- Fallencake.UI.dll
Concrete UI audio handler for DropdownMenu that plays open/close and selection-related sounds via a shared UnityEngine.AudioSource.
public class DropdownAudioHandler : UIAudioHandler<IDropdownAudioProvider>, IAudioEventHandler, IDropdownAudioHandler, IAudioHandler
- Inheritance
-
objectDropdownAudioHandler
- Implements
- Inherited Members
Constructors
DropdownAudioHandler(IDropdownAudioProvider)
public DropdownAudioHandler(IDropdownAudioProvider provider)
Parameters
providerIDropdownAudioProvider
Properties
CloseSound
Sound when closing the dropdown menu.
public AudioClip CloseSound { get; }
Property Value
- AudioClip
OpenSound
Sound when opening the dropdown menu.
public AudioClip OpenSound { get; }
Property Value
- AudioClip
SelectItemSound
Sound when selecting an item from the list.
public AudioClip SelectItemSound { get; }
Property Value
- AudioClip
Methods
Create(IDropdownAudioProvider)
Factory that constructs a handler when sounds are enabled and ensures an UnityEngine.AudioSource exists.
public static DropdownAudioHandler Create(IDropdownAudioProvider provider)
Parameters
providerIDropdownAudioProviderAudio-capable dropdown provider.
Returns
PlayCloseSound()
Plays the close dropdown menu sound.
public void PlayCloseSound()
PlayOpenSound()
Plays the open dropdown menu sound.
public void PlayOpenSound()
PlaySelectItemSound()
Plays the select item sound from the list.
public void PlaySelectItemSound()