Is there any feature to play click sound on every button in scene? :)
Is there any feature to play click sound on every button in scene? :) I mean, when i click on button to play music, and the others too? In just one main script attached to empy game object? :)
Comment
@DanRais You have to add code to your every script you have a button in.
Put this at the top and assign the elements:
[Header("ButtonPressSound")]
public AudioSource pressButtonSound;
This is where my Buttons go in my one script:
// All Buttons Go Here //
public void PlayGame()
{
player$$anonymous$$enu.SetActive(false);
pressButtonSound.Play();
mainGame$$anonymous$$usic.UnPause();
pause$$anonymous$$enu$$anonymous$$usic.Pause();
Cursor.visible = true;
setUpPlayer$$anonymous$$enu = false;
Time.timeScale = 1;
thePlayer.GetComponent<Cube$$anonymous$$ovement>().enabled = true;
playerNameDisplay.SetActive(true);
savePositionButton.SetActive(true);
loadPositionButton.SetActive(true);
}
You can customize your audio per script/button too. Have fun! HAPPY CLIC$$anonymous$$ING ^_^
Your answer
Follow this Question
Related Questions
Android audio latency 0 Answers
What is the best way to integrate sound/sound effects and Narration? 0 Answers
Soundarray for player is not working properly 1 Answer
How I can get the audio level in dB (via script) ? 0 Answers
Pick Up Sound 0 Answers