- It helps when you have Unity engine game.
- It helps when you use Unity UI and <Button> component for all buttons.
- It helps when you use EventTrigger with PointerClick event.
- It helps when you have many buttons in the scene and you have to add click sound to them all.
- It helps when you have to edit click sound for buttons, periodically.
How To Use.
- Download the latest version of editor from github.com: Button sounds editor.
- Install <ButtonSoundsEditor.unitypackage> into your project.
- Open the scene with <Button> or <EventTrigger> components.
- Open the editor window from menu <Window -> Utils ->Button sounds editor>
- Editor window will be opened.
- All click sounds are played using audio source. If you have audio source for this purposes, you can assign it to the <Audio Source> field. Also, you can create new audio source using the <Create> button or manually.
- Set the click sound to the <Click Sound> field.
- Click <Add click sound to ALL> button. All buttons have click sound, now.
- Play the game and test.
How it works.
- Editor uses the <Button Click Sound> component with two parameters: <Audio Source> and <Click Sound>.
- Editor adds/removes<Button Click Sound> component to game object with <Button> or <EventTrigger> component. And passes parameters from the editor window.
- On <Awake> component subscribes on button click event for <Button> or on PointerClick event for <EventTrigger>. Callback plays <Click Sounds> audio clip, using <Audio Source> audio source in the click handler.
- Editor allows to assign different sounds to different buttons. Use button’s row for that.
- Editor allows to play sound, using <Play> button in editor.
- Editor shows image for the selected button, its text and path to the game object in the scene, for better buttons control in single window.
|The latest version of editor.||Free editor in Unity Assets Store.||You can donate me 5$ using PayPal|