Ejemplo n.º 1
0
    /// <summary>
    /// This method will be called during the mouse drag
    /// </summary>
    /// <param name="eventData">mouse pointer event data</param>
    public void OnDrag(PointerEventData eventData)
    {
        transform.rotation = Quaternion.identity;
        cardsInHand.BlockButton();
        Vector3 oldPos = rect.position;

        rect.position = eventData.position;

        if (eventData.hovered.Exists(a => a.name == "DropCardPanel"))
        {
            glowParticle.SetActive(true);
        }
        else
        {
            glowParticle.SetActive(false);
        }

        if (!IsRectTransformInsideSreen(rect))
        {
            rect.position = oldPos;
        }
        lastMousePosition = eventData.position;
    }