Ejemplo n.º 1
0
    public void UpdateUIForDragCard(Card card)
    {
        CardContainer candidateContainer = GetMouseoverCandidate(card);
        CardDeck      candidateSlot      = GetMouseoverSlot(card);

        if (candidateContainer != mouseOverContainer)
        {
            if (mouseOverContainer != null)
            {
                mouseOverContainer.EndFocus();
            }
            mouseOverContainer = candidateContainer;
            card.SetCandidateContainer(mouseOverContainer);
            if (mouseOverContainer != null)
            {
                mouseOverContainer.StartFocus();
            }
        }

        if (candidateSlot != mouseOverSlot)
        {
            if (mouseOverSlot != null)
            {
                mouseOverSlot.EndFocus();
            }
            mouseOverSlot = candidateSlot;
            card.SetCandidateSlot(mouseOverSlot);
        }

        if (mouseOverSlot != null)
        {
            if (mouseOverContainer == null)
            {
                mouseOverSlot.StartFocus();
            }
            else
            {
                mouseOverSlot.EndFocus();
            }
        }
    }