1
I’m having trouble with a project. I set a button to turn the sounds on and off, works on the pc, but when I put it on the phone it only works if I click two places at the same time on the touch, if I just click on the button it recognizes the touch, but like (turn it off and turn the sound on again)...
case TouchPhase.Began:
som = true;
gameObject.GetComponent.<AudioSource>().Play();
player_controle.ativarSom = 2;
som = false;
break;
if (ativarSom > 1){
PlayerPrefs.DeleteKey("caso1");
PlayerPrefs.DeleteKey("caso2");
PlayerPrefs.DeleteKey("caso3");
PlayerPrefs.DeleteKey("caso4");
som *= -1;
ativarSom = 1;
}
if(som == 1 && efeitos == 1){
PlayerPrefs.SetInt("caso1", acustica);
}
if(som == 1 && efeitos < 1){
PlayerPrefs.SetInt("caso2", acustica);
}