public void OnEndDrag(PointerEventData data) { if (!this.gameObject.GetComponent <Card>().HasBeenPlaced) { //Debug.Log ("on end drag"); isDragging = false; dm = GameObject.Find("GM").GetComponent <dropManager>(); GameObject draggingCard = GameObject.FindGameObjectWithTag("Dragging"); GameObject pointerObject = data.pointerCurrentRaycast.gameObject; //dm.Drop(data, draggingCard, pointerObject.transform); try { dm.Drop(data, draggingCard, pointerObject.transform); } catch { Debug.Log("Nice try, JOHNATHAN!"); } this.transform.SetParent(parentToReturnTo); GetComponent <CanvasGroup>().blocksRaycasts = true; this.GetComponent <Image>().raycastTarget = true; } }
public void OnEndDrag(PointerEventData data) { if (!this.gameObject.GetComponent<Card>().HasBeenPlaced) { //Debug.Log ("on end drag"); isDragging = false; dm = GameObject.Find("GM").GetComponent<dropManager>(); GameObject draggingCard = GameObject.FindGameObjectWithTag("Dragging"); GameObject pointerObject = data.pointerCurrentRaycast.gameObject; //dm.Drop(data, draggingCard, pointerObject.transform); try { dm.Drop(data, draggingCard, pointerObject.transform); } catch { Debug.Log("Nice try, JOHNATHAN!"); } this.transform.SetParent(parentToReturnTo); GetComponent<CanvasGroup>().blocksRaycasts = true; this.GetComponent<Image>().raycastTarget = true; } }