// Use this for initialization void Start() { //Find Gameobjects and store into references //AnswersPanel = GameObject.Find("AnswersPanel"); //RecordButton = GameObject.Find("RecordButton"); //StopRecord = GameObject.Find("StopRecord"); //Deactive stop button KrKeyboard.SetActive(false); StopRecord.SetActive(false); counter = 0; UIManagerScript.FlashCard fc = (UIManagerScript.FlashCard)UIManagerScript.set[counter]; sizeofSet = UIManagerScript.set.Count; GameObject answerText = GameObject.Find("AnswerText"); Text answer = answerText.GetComponent <Text>(); answer.text = fc.enWord + "\n(" + fc.enType + ")"; GameObject krText = GameObject.Find("krText"); Text kr = krText.GetComponent <Text>(); RatingsText.GetComponent <Text>().text = fc.totalRating1 + "\n" + fc.totalRating2 + "\n" + fc.totalRating3; kr.text = fc.krWord; print(fc.fcid); loadImage(fc.fcid); loadAudio(fc.fcid); GameObject levelLabel = GameObject.Find("LevelLabel"); WordCounter.GetComponent <Text>().text = "1/" + sizeofSet; levelLabel.GetComponent <Text>().text = UIManagerScript.CurrentLevel; HideAnswers(); }
public void Rating3() { //User indicated Rating3 for this word, so update the appropriate field and ShowNext() UIManagerScript.FlashCard fc = (UIManagerScript.FlashCard)UIManagerScript.set[counter]; fc.totalRating3++; ShowNext(); }
public void ShowNext() { //Use the counter field. If the counter field > # of elements in list, then reset the counter. counter++; if (counter >= UIManagerScript.set.Count) { counter = 0; } UIManagerScript.FlashCard fc = (UIManagerScript.FlashCard)UIManagerScript.set[counter]; GameObject answerText = GameObject.Find("AnswerText"); Text answer = answerText.GetComponent <Text>(); answer.text = fc.enWord + "\n(" + fc.enType + ")"; GameObject krText = GameObject.Find("krText"); Text kr = krText.GetComponent <Text>(); kr.text = fc.krWord; print(fc.fcid); loadAudio(fc.fcid); loadImage(fc.fcid); WordCounter.GetComponent <Text>().text = counter + 1 + "/" + sizeofSet; RatingsText.GetComponent <Text>().text = fc.totalRating1 + "\n" + fc.totalRating2 + "\n" + fc.totalRating3; ClearFields(); HideAnswers(); }