public void OnEndDrag(PointerEventData ev) { CardGrid targetCardGrid = possibleCardGrid == null || !possibleCardGrid.canAddCard ? parentCardGrid : possibleCardGrid; if (targetCardGrid != null) { transform.SetParent(targetCardGrid.transform); } if (targetCardGrid != parentCardGrid) { parentCardGrid.RemoveCard(gameObject); targetCardGrid.AddCard(gameObject); siblingIndex = transform.GetSiblingIndex(); } else { transform.SetSiblingIndex(siblingIndex); } if (cGroup != null) { cGroup.blocksRaycasts = true; } parentCardGrid = null; possibleCardGrid = null; }