Esempio n. 1
0
    private void Update()
    {
        if (Dragging)
        {
            var mousePos = _camera.ScreenToWorldPoint(Input.mousePosition);
            mousePos.z = Dragging.transform.position.z;

            Dragging.MoveTo(mousePos);

            if (Input.GetMouseButtonUp(0))
            {
                var score = GetDropZoneAtPosition(mousePos);

                if (score)
                {
                    _results.Connect(Dragging, score);
                }
                else
                {
                    _results.Disconnect(Dragging);
                }

                Dragging = null;
            }
        }
    }