예제 #1
0
    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;
    }
예제 #2
0
 public void OnPointerClick(PointerEventData ev)
 {
     if (GameManager.cardView != null && activeCardsGrid != null && activeCardsGrid.canAddCard)
     {
         GameObject card = Instantiate(GameManager.cardView, GameManager.tableLayout);
         activeCardsGrid.AddCard(card);
     }
 }