I have a homepage with menu.
Sound is one among them.
While touch it sound, should get disable.
In next touch sound should get enable.
How can i on and off sound from menu while touching sound button?
Thanks in Advance
I have a homepage with menu.
Sound is one among them.
While touch it sound, should get disable.
In next touch sound should get enable.
How can i on and off sound from menu while touching sound button?
Thanks in Advance
I’m having a guess here, but you could possibly add the sound scripts to an empty game object called “sound”, and in the script where the sound button is located you could add a toggle function that where:
if sound is enabled
and we press sound button
, soundEnabled = false
and
if sound isn’t enabled
and we press sound button
, soundEnabled = true;
Take a look at the GUI.Toggle docs
if(AudioListener.pause == true){
AudioListener.pause = false;
}
else{
AudioListener.pause = true;
}