I have a guitexture for fwd button in Scene A. I am using a script attached to it to load next scenes based on number of touches. It is not working and need some help to run it on android.
On first touch on fwd button shows B, but gui texture does not respond to further clicks. It just stops responding. For quite some time, I am not able solve the problem or devise other method. Thank you for your help.
My code is as below.
var numclicks=0;
var mytext: GUIText;
function Update(){
if(touch.phase != TouchPhase.Ended touch.phase != TouchPhase.Canceled){
var touchPosition:Vector2 = Input.GetTouch(0).position;
if(guiTexture.HitTest(touchPosition)){
touchdo();
}
}
if(touch.phase == TouchPhase.Ended){
numclicks = numclicks + 1;
}
}
function touchdo(){
switch(numclicks){
case 0:
mytext.text = “B”;
break;
case 1:
mytext.text = “C”;
break;
}
}