private void FindSubString() { foreach (char c in Input.inputString) { if (c == "\b"[0]) { if (gt.text.Length != 0) { gt.text = gt.text.Substring(0, gt.text.Length - 1); } } else { gt.text += c; } WordSetPanel panel = FindPanelByCaption(gt.text); if (panel == null) { return; } GoToPanel(panel); EventSystem.current.SetSelectedGameObject(panel.gameObject); } }
private void GoToPanel(WordSetPanel panel) { int index = allWordSetPanel.ToList().FindIndex((x) => panel.GetName() == x.GetName()); float high = selectGroup.CalulateHightContainer(index + 1); selectGroup.SetHeigtContent(high); selectGroup.HighLightTile(index); }
internal void HighLightTile(int index) { WordSetPanel[] tiles = transform.GetComponentsInChildren <WordSetPanel>(); foreach (var item in tiles) { item.GetComponent <Image>().color = Color.white; } WordSetPanel tile = tiles[index]; tile.GetComponent <Image>().color = Color.yellow; }
private void CreateCard(Sprite sprite, string caption, int count) { WordSetPanel setPanel = Instantiate(panelPrefab, content.transform); setPanel.Init(sprite, caption, count); }