Esempio n. 1
0
 private void Awake()
 {
     TouchManager = new TouchManager(2);
     TouchManager.RegisterGestureListener(this);
     Input.simulateMouseWithTouches = true;
     GestureType = GestureEventType.GESTURE_UNKNOWN;
 }
Esempio n. 2
0
 private void HandleTouch(int touchFingerId, Vector3 position, TouchPhase touchPhase)
 {
     if (touchPhase == TouchPhase.Began)
     {
         TouchManager.AddTouch((int)position.x, (int)position.y, touchFingerId);
     }
     else if (touchPhase == TouchPhase.Ended)
     {
         TouchManager.ReleaseTouch((int)position.x, (int)position.y, touchFingerId);
     }
     else if (touchPhase == TouchPhase.Moved)
     {
         TouchManager.TouchMove((int)position.x, (int)position.y, touchFingerId);
     }
     else if (touchPhase == TouchPhase.Stationary)
     {
         TouchManager.TouchMove((int)position.x, (int)position.y, touchFingerId);
     }
     else if (touchPhase == TouchPhase.Canceled)
     {
         TouchManager.ReleaseTouch((int)position.x, (int)position.y, touchFingerId);
     }
 }
Esempio n. 3
0
 private void OnDestroy()
 {
     TouchManager.UnRegisterGestureListener(this);
     TouchManager.Clear();
 }
Esempio n. 4
0
 public void Update()
 {
     HandleInputTouch();
     HandleMouchTouch();
     TouchManager.Update();
 }