Пример #1
0
    public void updatePorEnglText()
    {
        GameObject   selectedCardUI = model.getSelectedCardUI();
        CardHolderES ch             = selectedCardUI.GetComponent <CardHolderES>();

        portugueseText.text       = ch.getPortugueseText();
        englishText.text          = ch.getEnglishText();
        actualLeitnerLevel.text   = ch.getLeitnerLevel();
        previousLeitnerLevel.text = ch.getPreviousLeitnerLevel();
        answer.text = ch.getUserAnswer();
    }
Пример #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)
        {
            CardHolderES ch1 = go1.GetComponent <CardHolderES>();
            CardHolderES ch2 = go2.GetComponent <CardHolderES>();
            return(ch1.getPortugueseText().CompareTo(ch2.getPortugueseText()));
        });

        selectedCardUI = cardUIList[0];
        setSelectedCardUI(selectedCardUI);
    }
Пример #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)
        {
            CardHolderES ch1 = go1.GetComponent <CardHolderES>();
            CardHolderES ch2 = go2.GetComponent <CardHolderES>();
            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);
        }
    }