How to Stop All Game Sound in All Scenes by simply pressing On/Off Button
Hello I'm New in this field So please help me .. I just want to stop all music by pressing a simple button "Off" from main menu and Want to Start Again All Sound of the game By Pressing another button "On" also located on main menu ...
i designed 20 Levels,Scenes for my game and want to stop All sound of the game from main menu But i can only stop the Sound,Music that is on the main menu when i go to the next scenes,Level Sound is not Mute .
I know its possible by using Void Awake() Function But i'm New So Please Give me the right solution,Logic ...Thanks
did you get the solution? I got this problem too. Please share the script :(
Answer by jandd661 · Jul 29, 2017 at 03:25 PM
I would suggest changing the AudioListner volume and saving that to Player.Prefs. Have your sense change/adjust the volume in the Start()
. More info:
https://docs.unity3d.com/ScriptReference/AudioListener.html
https://docs.unity3d.com/ScriptReference/PlayerPrefs.html
https://docs.unity3d.com/ScriptReference/PlayerPrefs.SetFloat.html
https://docs.unity3d.com/ScriptReference/PlayerPrefs.GetFloat.html
hope this helps