示例#1
0
    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);
        }
    }
示例#2
0
    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);
    }
示例#3
0
    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;
    }
示例#4
0
    private void CreateCard(Sprite sprite, string caption, int count)
    {
        WordSetPanel setPanel = Instantiate(panelPrefab, content.transform);

        setPanel.Init(sprite, caption, count);
    }