コード例 #1
0
ファイル: GUILayout.cs プロジェクト: qipa/UnityDecompiled-2
        private static string DoTextField(string text, int maxLength, bool multiline, GUIStyle style, GUILayoutOption[] options)
        {
            int        controlID  = GUIUtility.GetControlID(FocusType.Keyboard);
            GUIContent gUIContent = GUIContent.Temp(text);

            if (GUIUtility.keyboardControl != controlID)
            {
                gUIContent = GUIContent.Temp(text);
            }
            else
            {
                gUIContent = GUIContent.Temp(text + Input.compositionString);
            }
            Rect rect = GUILayoutUtility.GetRect(gUIContent, style, options);

            if (GUIUtility.keyboardControl == controlID)
            {
                gUIContent = GUIContent.Temp(text);
            }
            GUI.DoTextField(rect, controlID, gUIContent, multiline, maxLength, style);
            return(gUIContent.text);
        }
コード例 #2
0
ファイル: GUILayout.cs プロジェクト: zvars/UnityCsReference
        static string DoTextField(string text, int maxLength, bool multiline, GUIStyle style, GUILayoutOption[] options)
        {
            int        id      = GUIUtility.GetControlID(FocusType.Keyboard);
            GUIContent content = GUIContent.Temp(text);
            Rect       r;

            if (GUIUtility.keyboardControl != id)
            {
                content = GUIContent.Temp(text);
            }
            else
            {
                content = GUIContent.Temp(text + GUIUtility.compositionString);
            }

            r = GUILayoutUtility.GetRect(content, style, options);
            if (GUIUtility.keyboardControl == id)
            {
                content = GUIContent.Temp(text);
            }
            GUI.DoTextField(r, id, content, multiline, maxLength, style);
            return(content.text);
        }