generated from VR-Sexe/Unity3DTemplate
swipe almost finished
This commit is contained in:
parent
8cea51f47f
commit
e02467b154
@ -24,6 +24,7 @@ public class SwipeScript : MonoBehaviour
|
||||
Button btnRight = arrowRight.GetComponent<Button>();
|
||||
btnLeft.onClick.AddListener(PreviousText);
|
||||
btnRight.onClick.AddListener(NextText);
|
||||
imageText.sprite = lengths[0];
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
@ -44,22 +45,33 @@ public class SwipeScript : MonoBehaviour
|
||||
}
|
||||
|
||||
private void NextText(){
|
||||
numberImage ++;
|
||||
if(numberImage == lengthTexts){
|
||||
arrowRight.gameObject.SetActive(false);
|
||||
}else{
|
||||
arrowRight.gameObject.SetActive(true);
|
||||
if(numberImage < lengthTexts)
|
||||
{
|
||||
numberImage ++;
|
||||
if(numberImage == lengthTexts){
|
||||
arrowRight.gameObject.SetActive(false);
|
||||
}else{
|
||||
arrowRight.gameObject.SetActive(true);
|
||||
}
|
||||
if(numberImage != 0){
|
||||
arrowLeft.gameObject.SetActive(true);
|
||||
}
|
||||
imageText.sprite = lengths[numberImage];
|
||||
}
|
||||
imageText.sprite = lengths[numberImage];
|
||||
}
|
||||
|
||||
private void PreviousText(){
|
||||
numberImage --;
|
||||
if(numberImage == 0){
|
||||
arrowLeft.gameObject.SetActive(false);
|
||||
}else{
|
||||
arrowLeft.gameObject.SetActive(true);
|
||||
if(numberImage > 0) {
|
||||
numberImage --;
|
||||
if(numberImage == 0){
|
||||
arrowLeft.gameObject.SetActive(false);
|
||||
}else{
|
||||
arrowLeft.gameObject.SetActive(true);
|
||||
}
|
||||
if(numberImage != lengthTexts){
|
||||
arrowRight.gameObject.SetActive(true);
|
||||
}
|
||||
imageText.sprite = lengths[numberImage];
|
||||
}
|
||||
imageText.sprite = lengths[numberImage];
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user