Example #1
0
 // Use this for initialization
 void Start()
 {
     sw2 = Screen.width / 2;
     sh2 = Screen.height / 2;
     trackingMouseMovement = false;
     mousePosAtStart       = mouseDelta = 0;
     arrowDirection.SetActive(false);
     currentTeleportTurn = TeleportTurn.None;
 }
Example #2
0
    IEnumerator ChangeSwipeDirection()
    {
        int tempAngle;

        arrowDirection.SetActive(true);
        if (mouseDeltaFinal > deltaLimit)
        {
            tempAngle           = arrowDeltaAngle;
            currentTeleportTurn = TeleportTurn.Right;
        }
        else
        {
            tempAngle           = -arrowDeltaAngle;
            currentTeleportTurn = TeleportTurn.Left;
        }

        arrowDirection.transform.rotation = Quaternion.Euler(270, 180 + tempAngle, 0);
        yield return(new WaitForSeconds(swipeDirectionDuration));

        arrowDirection.SetActive(false);
        mousePosAtStart     = mouseDelta = 0;
        currentTeleportTurn = TeleportTurn.None;
    }