Quantcast
Channel: Latest Questions by Uping
Viewing all articles
Browse latest Browse all 56

Mute volume / sound problem

$
0
0
okay my problem is when i press the mute button it works fine and unmute is fine but the problem is ive set it with a picture button but what happens is when I mute it and go to the next scene and go back again the volume is still muted but the button for it is for not muted okay here's my code void OnGUI(){ if(yMute){ if (GUI.Button(new Rect(100, 10, 100, 50), "",Y)) { AudioListener.volume = 0.0F; muted = true; nMute = true; yMute = false; } } if(nMute){ if (GUI.Button(new Rect(100, 10, 100, 50), "",N)) { AudioListener.volume = 1.0F; muted = false; nMute = false; yMute = true; } } } void Start () { yMute = true; } // Update is called once per frame void Update () { if (yMute == true) { nMute = false; } else { nMute = true; } } } so what I need is when i press my mute button the picture will change for the unmute and when i press it again the unmute will change for the mute picture it works fine but when i go to the next scene and go back here again the volume is muted but my button is for not muted so how can i fix that ? please help me thank you

Viewing all articles
Browse latest Browse all 56

Latest Images

Trending Articles





Latest Images