コード例 #1
0
    void OnMouseUp()
    {
        // We get the camera to cancel the Z vector and ScreenToWorldPoint returns distances in the same Z value
        float cameraZPos = Camera.main.transform.position.z;

        finalTouchPosition = Camera.main.ScreenToWorldPoint(Input.mousePosition + new Vector3(0f, 0f, -cameraZPos));

        if (OnMouseOverItemEventHandler != null)
        {
            SwipeDirection direction = InputHelpers.GetSwipeDirection(new Vector2(x, y), finalTouchPosition, 0.5f);
            OnMouseOverItemEventHandler(this, direction);
        }
    }