当前位置: 首页>>代码示例>>C#>>正文


C# GUIStyle.DrawPrefixLabel方法代码示例

本文整理汇总了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;
   }
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:35,代码来源:EditorGUI.cs

示例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;
		}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:39,代码来源:EditorGUI.cs


注:本文中的UnityEngine.GUIStyle.DrawPrefixLabel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。