internal static Rect DrawIconLeft( Rect rect, float rowHeight, Texture icon, Texture overlayIcon) { if (icon == null) { return(rect); } float iconWidth = rowHeight * ((float)icon.width / icon.height); Rect iconRect = new Rect(rect.x, rect.y, iconWidth, rowHeight); EditorGUI.LabelField(iconRect, new GUIContent(icon), UnityStyles.Tree.IconStyle); if (overlayIcon != null) { Rect overlayIconRect = OverlayRect.GetRightBottonRect(iconRect); GUI.DrawTexture( overlayIconRect, overlayIcon, ScaleMode.ScaleToFit); } rect.x += iconRect.width; rect.width -= iconRect.width; return(rect); }
internal static void ForStatus( Rect selectionRect, AssetStatus status, string tooltipText) { Texture overlayIcon = GetOverlayIcon(status); if (overlayIcon == null) { return; } Rect overlayRect = OverlayRect.GetRightBottonRect( selectionRect); GUI.DrawTexture( overlayRect, overlayIcon, ScaleMode.ScaleToFit); Rect tooltipRect = GetTooltipRect(selectionRect, overlayRect); GUI.Label(tooltipRect, new GUIContent(string.Empty, tooltipText)); }