예제 #1
0
 /// <summary>
 /// Detects if the wrong swipe was made.
 /// </summary>
 /// <returns>True if the wrong swipe was made.</returns>
 public bool DetectWrongSwipe(SwipeController.Directions s)
 {
     if (sc.Swipe() != SwipeController.Directions.NO_DIRECITON && sc.Swipe() != s)
     {
         Debug.Log("Wrong swipe made!");
         return(true);
     }
     return(false);
 }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        _swipeC.Swipe();
        cRot = transform.eulerAngles;
        if (!stop)
        {
            float newXangle = Mathf.SmoothDampAngle(cRot.x, endRotEuler.x, ref speedX, time, maxSpeed);
            float newYangle = Mathf.SmoothDampAngle(cRot.y, endRotEuler.y, ref speedY, time, maxSpeed);
            transform.eulerAngles = new Vector3(newXangle, newYangle, transform.eulerAngles.z);
            if (Mathf.Abs(speedX) < 0.001f)
            {
                stop = true;
            }
        }

        if (_swipeC.isHorizontal)
        {
            transform.RotateAround(new Vector3(0, 0, 0), Vector3.up, _swipeC.deltaX * 3.5f * Time.deltaTime);
        }
    }