public void UpdateCount(string word, int newCount) { string upperWord = word.ToUpper(); if (filteredWords.ContainsKey(upperWord)) { upperWord = filteredWords[upperWord].ToUpper(); } if (!remainingWords.ContainsKey(upperWord)) { Debug.Log("RemainingWordlistBehaviour.UpdateCount(): word not found (" + word + ")"); return; } GameObject go = remainingWords[upperWord]; go.transform.Find(REMAINING_WORD_ITEM_COUNT).GetComponent <Text>().text = "x" + newCount; CanvasFadeBehaviour strikethoughFader = go.transform.Find(REMAINING_WORD_ITEM_STRIKETHROUGH).GetComponent <CanvasFadeBehaviour>(); CanvasFadeBehaviour goFader = go.GetComponent <CanvasFadeBehaviour>(); if (newCount == 0) { strikethoughFader.Show(true); goFader.Hide(true); } else { strikethoughFader.Hide(true); goFader.Show(true); } }
void Awake() { panelImage = transform.Find(PANEL).Find(PANEL_IMAGE).GetComponent <Image>(); titleText = transform.Find(PANEL).Find(PANEL_TITLE).GetComponent <Text>(); mCanvasFadeBehaviour = GetComponent <CanvasFadeBehaviour>(); wordListItemContainer = transform.Find(PANEL).Find(PANEL_WORD_LIST).Find("Viewport").Find("Content").gameObject; durationContainer = transform.Find(PANEL).Find(PANEL_FINISH_WITHIN).gameObject; durationText = durationContainer.transform.Find(PANEL_FINISH_WITHIN_DURATION).GetComponent <Text>(); }