Mute Button for mobile devices.
Hi! I want to make a mute button for phone devices but don't really know where to put it. I think I should make a new button with a script doing a Mute to Audio Source. Is that right?
Comment
Best Answer
Answer by UnityCoach · Apr 16, 2017 at 10:37 PM
If you have more than one AudioSource, it will be easier to handle it with an AudioMixer.
Well then, you can simply put the AudioSource.volume to 0/1. I believe you don't even need to script anything, using the onClick event of a Button, you can add the AudioSource you want to control, choose its volume property, and put 0 in the value field. The button would also set active itself to false, and set active another button to true. The other button would simply do the opposite.