responsive + swipe
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user