Example #1
0
    public void OnEndDrag(PointerEventData eventData)
    {
        AudioManager.Instance.Play("DropDocument");
        canvasGroup.blocksRaycasts = true;
        //manager.heldDoc = null;

        if (cursor)
        {
            cursor.SetHand(true);
            cursor.ResetImagePos();
        }
    }
Example #2
0
    private void Update()
    {
        if (Input.GetMouseButtonUp(0))
        {
            if (manager.heldDoc)
            {
                Document doc = manager.heldDoc.GetComponent <Document>();
                if (rectOverlaps(doc.transform.GetChild(1).GetComponent <RectTransform>(), rectTrans))
                {
                    if (feedbackText)
                    {
                        if (positive)
                        {
                            StartCoroutine(ShowFeedback(doc.points));
                        }
                        else
                        {
                            StartCoroutine(ShowFeedback(-doc.points));
                        }
                    }

                    doc.RunEffect(positive);

                    if (cursor)
                    {
                        cursor.ResetImagePos();
                        cursor.SetHand(true);
                    }

                    manager.heldDoc = null;
                }
            }
            else
            {
                Debug.Log("no document is being held");
            }
        }
    }