示例#1
0
        public static string TextField(string text, GUILayoutOption[] options)
        {
            text = text ?? string.Empty;

            int        controlID  = GUIUtility.GetControlID(FocusType.Keyboard);
            GUIContent guicontent = GUIContent.Temp(text);
            bool       flag       = GUIUtility.keyboardControl != controlID;

            if (flag)
            {
                guicontent = GUIContent.Temp(text);
            }
            else
            {
                guicontent = GUIContent.Temp(text);
                // guicontent = GUIContent.Temp(text + GUIUtility.compositionString);
            }
            Rect rect  = Internal_LayoutUtility.GetRect(guicontent, GUI.skin.textField, options);
            bool flag2 = GUIUtility.keyboardControl == controlID;

            if (flag2)
            {
                guicontent = GUIContent.Temp(text);
            }
            DoTextField(rect, controlID, guicontent, false, -1, GUI.skin.textField);
            return(guicontent.text);
        }
示例#2
0
        public static void Space(float pixels)
        {
            if (GUILayoutUtility.current.topLevel.isVertical)
            {
                Internal_LayoutUtility.GetRect(0, pixels, SpaceStyle, new GUILayoutOption[] { GUILayout.Height(pixels) });
            }
            else
            {
                Internal_LayoutUtility.GetRect(pixels, 0, SpaceStyle, new GUILayoutOption[] { GUILayout.Width(pixels) });
            }

            if (Event.current.type == EventType.Layout)
            {
                GUILayoutUtility.current.topLevel.entries[GUILayoutUtility.current.topLevel.entries.Count - 1].consideredForMargin = false;
            }
        }
示例#3
0
 public static bool DoRepeatButton(GUIContent content, GUIStyle style, GUILayoutOption[] options)
 {
     return(GUI.DoRepeatButton(Internal_LayoutUtility.GetRect(content, style, options), content, style, FocusType.Passive));
 }