responsive + swipe

This commit is contained in:
esteb
2023-01-19 11:05:40 +01:00
parent 99b52ecf4c
commit d4996868f3
21 changed files with 2180 additions and 811 deletions

View File

@@ -15,8 +15,7 @@ public class SwipeManagementScript : MonoBehaviour
public GameObject arrowLeft;
public GameObject arrowRight;
public GameObject imgDown;
public GameObject imgUp;
public Animator m_Animator;
public TMP_Text textNumber;
@@ -43,9 +42,10 @@ public class SwipeManagementScript : MonoBehaviour
}else{
PreviousText();
}
if(endTouchPosition.y < startTouchPosition.y){
if(endTouchPosition.y + 100 < startTouchPosition.y){
SwipeDown();
} else {
}
if(endTouchPosition.y - 100 > startTouchPosition.y){
SwipeUp();
}
}
@@ -85,11 +85,11 @@ public class SwipeManagementScript : MonoBehaviour
}
private void SwipeDown(){
imgDown.SetActive(true);
imgUp.SetActive(false);
m_Animator.ResetTrigger("SwipeUp");
m_Animator.SetTrigger("SwipeDown");
}
private void SwipeUp(){
imgDown.SetActive(false);
imgUp.SetActive(true);
m_Animator.ResetTrigger("SwipeDown");
m_Animator.SetTrigger("SwipeUp");
}
}