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(); }
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); }
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); } }