Ejemplo n.º 1
0
    public void updatePorEnglText()
    {
        GameObject selectedCardUI = model.getSelectedCardUI();
        CardHolder ch             = selectedCardUI.GetComponent <CardHolder>();

        portugueseText.text = ch.getPortugueseText();
        englishText.text    = ch.getEnglishText();
    }
Ejemplo n.º 2
0
    public void init(Deck deck)
    {
        this.deck = deck;
        List <Card> cardList = deck.cardList;

        foreach (Card card in cardList)
        {
            cardUIList.Add(createUICard(card));
        }

        cardUIList.Sort(delegate(GameObject go1, GameObject go2)
        {
            CardHolder ch1 = go1.GetComponent <CardHolder>();
            CardHolder ch2 = go2.GetComponent <CardHolder>();
            return(ch1.getPortugueseText().CompareTo(ch2.getPortugueseText()));
        });

        selectedCardUI = cardUIList[0];
        setSelectedCardUI(selectedCardUI);
    }
Ejemplo n.º 3
0
    public void updateCardContainer()
    {
        while (cardContainer.transform.childCount > 0)
        {
            Transform child = cardContainer.transform.GetChild(0);
            child.parent = null;
        }

        List <GameObject> cardUIList = model.getCardUIList();

        cardUIList.Sort(delegate(GameObject go1, GameObject go2)
        {
            CardHolder ch1 = go1.GetComponent <CardHolder>();
            CardHolder ch2 = go2.GetComponent <CardHolder>();
            return(ch1.getPortugueseText().CompareTo(ch2.getPortugueseText()));
        });

        foreach (GameObject cardUI in cardUIList)
        {
            cardUI.transform.localScale = new Vector3(1, 1, 1);
            cardUI.transform.SetParent(cardContainer.transform, false);
        }
    }