Beispiel #1
0
    private void OnMouseDrag()
    {
        if (_selectable.ClickedThisFrame)
        {
            return;
        }
        RaycastHit hit = new RaycastHit();

        if (Physics.Raycast(_camera.ScreenPointToRay(Input.mousePosition), out hit, 100f, _rayCastMask))
        {
            transform.position = hit.point;
        }
        else
        {
            transform.position = _selectable.GetMouseAsWorldPoint() + mOffset;
        }
    }