UnityEngine.GUIStyle.DrawPrefixLabel C# (CSharp) Method

DrawPrefixLabel() private method

private DrawPrefixLabel ( Rect position, GUIContent content, int controlID ) : void
position Rect
content GUIContent
controlID int
return void
        internal void DrawPrefixLabel(Rect position, GUIContent content, int controlID)
        {
            if (content != null)
            {
                Internal_DrawPrefixLabel(this.m_Ptr, position, content, controlID, false);
            }
            else
            {
                Debug.LogError("Style.DrawPrefixLabel may not be called with GUIContent that is null.");
            }
        }

Usage Example

コード例 #1
0
 internal static void HandlePrefixLabelInternal(Rect totalPosition, Rect labelPosition, GUIContent label, int id, GUIStyle style)
 {
   if (id == 0 && label != null)
   {
     EditorGUI.s_PrefixLabel.text = label.text;
     EditorGUI.s_PrefixLabel.image = label.image;
     EditorGUI.s_PrefixLabel.tooltip = label.tooltip;
     EditorGUI.s_PrefixTotalRect = totalPosition;
     EditorGUI.s_PrefixRect = labelPosition;
     EditorGUI.s_PrefixStyle = style;
   }
   else
   {
     if (Highlighter.searchMode == HighlightSearchMode.PrefixLabel || Highlighter.searchMode == HighlightSearchMode.Auto)
       Highlighter.Handle(totalPosition, label.text);
     switch (Event.current.type)
     {
       case EventType.MouseDown:
         if (Event.current.button == 0 && labelPosition.Contains(Event.current.mousePosition))
         {
           if (EditorGUIUtility.CanHaveKeyboardFocus(id))
             GUIUtility.keyboardControl = id;
           EditorGUIUtility.editingTextField = false;
           HandleUtility.Repaint();
           break;
         }
         break;
       case EventType.Repaint:
         ++labelPosition.width;
         style.DrawPrefixLabel(labelPosition, label, id);
         break;
     }
     EditorGUI.s_PrefixLabel.text = (string) null;
   }
 }
All Usage Examples Of UnityEngine.GUIStyle::DrawPrefixLabel