Пример #1
0
    public void OnInputValueChanged()
    {
        Debug.Log("OnInputValueChanged " + InputField.text.Trim());
        if (InputField.text.Trim() != "")
        {
            ButtonClearText.SetActive(true);
        }
        else
        {
            ButtonClearText.SetActive(false);
            Debug.Log("OnInputValueChanged Search for all songs");
        }

        songScrollList.RefreshDisplay();
    }
Пример #2
0
    public void OnInputValueChanged()
    {
        Helpers.SearchText = InputField.text.Substring(0, Mathf.Min(InputField.text.Trim().Length, 100));
        Helpers.SearchText = Helpers.SearchText.Trim();
        Debug.Log("OnInputValueChanged " + Helpers.SearchText);

        if (!string.IsNullOrEmpty(Helpers.SearchText))
        {
            ButtonClearText.SetActive(true);
        }
        else
        {
            ButtonClearText.SetActive(false);
            Debug.Log("OnInputValueChanged Search for all songs");
        }


        songScrollList.RefreshDisplay();


        foreach (Transform child in transform)
        {
            if (!child.name.Contains("Button"))
            {
                continue;
            }

            if (string.IsNullOrEmpty(Helpers.SearchText))
            {
                child.gameObject.SetActive(true);
            }
            else
            {
                child.gameObject.SetActive(false);
            }
        }
    }