Problems in the Android version

Asked

Viewed 46 times

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);

}
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.