浏览代码

Made the Breadcrumb Bar a bit less intrusive

/refactor-gui-overhaul
Thomas ICHÉ 4 年前
当前提交
46b1c247
共有 4 个文件被更改,包括 14 次插入11 次删除
  1. 3
      Editor/CustomInspectors/ActionBaseEditor.cs
  2. 16
      Editor/CustomInspectors/IngredientEditor.cs
  3. 4
      Editor/CustomInspectors/RigEditor.cs
  4. 2
      Editor/IngredientsExplorer/IngredientsExplorerWindow.cs

3
Editor/CustomInspectors/ActionBaseEditor.cs


DrawBreadCrumb("Action", color, () =>
{
NaughtyEditorGUI.PropertyField_Layout(m_Name, true);
using (new GUILayout.VerticalScope(GUILayout.ExpandWidth(true)))
NaughtyEditorGUI.PropertyField_Layout(m_Name, true);
OpenIngredientsExplorerButton(serializedObject.targetObject as ActionBase);
});

16
Editor/CustomInspectors/IngredientEditor.cs


using (new GUILayout.HorizontalScope(Styles.breadCrumbBar))
{
Color c = GUI.backgroundColor;
color *= 0.6f;
color.a = 1;
GUI.backgroundColor = color;
GUILayout.Label(label, Styles.breadCrumb);
float bg = EditorGUIUtility.isProSkin ? .3f : .9f;
GUI.backgroundColor = new Color(bg, bg, bg, 1);
Rect r = GUILayoutUtility.GetRect(8,8, 22,22, GUILayout.Width(8));
EditorGUI.DrawRect(r, color);
GUILayout.Label(label, Styles.breadCrumb, GUILayout.MinWidth(28));
using(new GUILayout.HorizontalScope(GUILayout.ExpandWidth(true)))
content.Invoke();
content.Invoke();
else
GUILayout.FlexibleSpace();
}

breadCrumb.margin = new RectOffset();
breadCrumb.onNormal.background = bc;
breadCrumb.onNormal.textColor = Color.white;
breadCrumb.onNormal.textColor = EditorGUIUtility.isProSkin? Color.white : Color.black;
breadCrumb.onHover = breadCrumb.onNormal;
breadCrumb.onActive = breadCrumb.onNormal;
breadCrumb.onFocused = breadCrumb.onNormal;

4
Editor/CustomInspectors/RigEditor.cs


DrawBreadCrumb("Rig", color, () =>
{
GUILayout.Label(ObjectNames.NicifyVariableName(serializedObject.targetObject.GetType().Name), GUILayout.ExpandWidth(true));
GUILayout.Label(ObjectNames.NicifyVariableName(serializedObject.targetObject.GetType().Name));
GUILayout.FlexibleSpace();
OpenIngredientsExplorerButton(serializedObject.targetObject as Rig);
});

2
Editor/IngredientsExplorer/IngredientsExplorerWindow.cs


menu.DropDown(buttonRect);
}
if(position.width > MIN_WIDTH)
showPanel = GUILayout.Toggle(showPanel, "...", EditorStyles.toolbarButton);
showPanel = GUILayout.Toggle(showPanel, EditorGUIUtility.IconContent("UnityEditor.InspectorWindow"), EditorStyles.toolbarButton);
}
using(new GUILayout.HorizontalScope())

正在加载...
取消
保存