本文整理汇总了C#中UnityEngine.GUIStyle.DrawPrefixLabel方法的典型用法代码示例。如果您正苦于以下问题:C# GUIStyle.DrawPrefixLabel方法的具体用法?C# GUIStyle.DrawPrefixLabel怎么用?C# GUIStyle.DrawPrefixLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.GUIStyle
的用法示例。
在下文中一共展示了GUIStyle.DrawPrefixLabel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandlePrefixLabelInternal
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;
}
}
示例2: HandlePrefixLabelInternal
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;
return;
}
if (Highlighter.searchMode == HighlightSearchMode.PrefixLabel || Highlighter.searchMode == HighlightSearchMode.Auto)
{
Highlighter.Handle(totalPosition, label.text);
}
EventType type = Event.current.type;
if (type != EventType.MouseDown)
{
if (type == EventType.Repaint)
{
labelPosition.width += 1f;
style.DrawPrefixLabel(labelPosition, label, id);
}
}
else
{
if (Event.current.button == 0 && labelPosition.Contains(Event.current.mousePosition))
{
if (EditorGUIUtility.CanHaveKeyboardFocus(id))
{
GUIUtility.keyboardControl = id;
}
EditorGUIUtility.editingTextField = false;
HandleUtility.Repaint();
}
}
EditorGUI.s_PrefixLabel.text = null;
}