예제 #1
0
 public void CtrlPressed()
 {
     if (!CursorManager.CursorVisible())
     {
         CursorManager.ShowAndUnlockCursor();
     }
     else
     {
         CursorManager.HideAndLockCursor();
     }
 }
예제 #2
0
    public void mouseDeltaYChanged(float amount)
    {
        if (!CursorManager.CursorVisible())
        {
            Vector3 position = transform.position;
            float   newy     = position.y;

            if (Input.touchCount > 0)
            {
                Vector3 touchPosition = Camera.main.ScreenToWorldPoint(new Vector3(Input.GetTouch(0).position.x, Input.GetTouch(0).position.y, 5));
                if (touchPosition.x < 5)
                {
                    newy = touchPosition.y;
                }
            }
            else
            {
                newy = position.y + amount;
            }
            position.y         = Mathf.Clamp(newy, -yBound, yBound);
            transform.position = position;
        }
    }