Пример #1
0
    void SimulateTextField()
    {
        string oldText = m_FocusedTextField.TextFieldText;

        if (oldText == null)
        {
            oldText = "";
        }
        string newText = "";

        GUI.SetNextControlName(m_FocusedTextField.name);
        if (m_FocusedTextField.TextFieldIsMultiline)
        {
            newText = GUI.TextArea(new Rect(0, -200, 5000, 200), oldText);
        }
        else
        {
            newText = GUI.TextField(new Rect(0, -20, 5000, 20), oldText);
        }
        if (newText != oldText)
        {
            m_TextChanged = true;
            m_FocusedTextField.TextFieldText = newText;
            if (m_FocusedTextField.TextFieldDelegate != null && m_FocusedTextField.TextFieldText != oldText)
            {
                m_FocusedTextField.TextFieldDelegate(m_FocusedTextField, m_FocusedTextField.TextFieldText, false);
            }
        }
    }