mirror of
https://github.com/DCFApixels/DragonECS-Unity.git
synced 2025-09-17 17:34:34 +08:00
update
This commit is contained in:
parent
2dd92d3dc6
commit
24ac089d1e
@ -188,18 +188,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
||||
if (propCount <= 0)
|
||||
{
|
||||
label.text = $"{label.text} ({name})";
|
||||
EditorGUI.LabelField(paddingPosition, label);
|
||||
Rect emptyPos = paddingPosition;
|
||||
emptyPos.xMin += EditorGUIUtility.labelWidth;
|
||||
if (isEmpty)
|
||||
{
|
||||
using (new EcsGUI.ContentColorScope(1f, 1f, 1f, 0.4f))
|
||||
{
|
||||
GUI.Label(emptyPos, "empty");
|
||||
}
|
||||
}
|
||||
EditorGUI.BeginProperty(paddingPosition, label, componentRefProp);
|
||||
EditorGUI.EndProperty();
|
||||
EcsGUI.DrawEmptyComponentProperty(paddingPosition, componentRefProp, label.text, isEmpty);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -194,19 +194,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
||||
|
||||
if (propCount <= 0)
|
||||
{
|
||||
GUIContent label = UnityEditorUtility.GetLabel(name);
|
||||
EditorGUILayout.LabelField(name);
|
||||
Rect emptyPos = GUILayoutUtility.GetLastRect();
|
||||
emptyPos.xMin += EditorGUIUtility.labelWidth;
|
||||
if (isEmpty)
|
||||
{
|
||||
using (new EcsGUI.ContentColorScope(1f, 1f, 1f, 0.4f))
|
||||
{
|
||||
GUI.Label(emptyPos, "empty");
|
||||
}
|
||||
}
|
||||
EditorGUI.BeginProperty(GUILayoutUtility.GetLastRect(), label, componentRefProp);
|
||||
EditorGUI.EndProperty();
|
||||
EcsGUI.Layout.DrawEmptyComponentProperty(componentRefProp, name, isEmpty);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -335,11 +335,33 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
||||
return AddClearComponentButton.None;
|
||||
}
|
||||
|
||||
public static void DrawEmptyComponentProperty(Rect position, SerializedProperty property, string name, bool isDisplayEmpty)
|
||||
{
|
||||
DrawEmptyComponentProperty(position, property, UnityEditorUtility.GetLabel(name), isDisplayEmpty);
|
||||
}
|
||||
public static void DrawEmptyComponentProperty(Rect position, SerializedProperty property, GUIContent label, bool isDisplayEmpty)
|
||||
{
|
||||
EditorGUI.LabelField(position, label);
|
||||
if (isDisplayEmpty)
|
||||
{
|
||||
using (SetContentColor(1f, 1f, 1f, 0.4f))
|
||||
{
|
||||
GUI.Label(position.AddPadding(EditorGUIUtility.labelWidth, 0, 0, 0), "empty");
|
||||
}
|
||||
}
|
||||
EditorGUI.BeginProperty(position, label, property);
|
||||
EditorGUI.EndProperty();
|
||||
}
|
||||
|
||||
public static class Layout
|
||||
{
|
||||
public static void DrawEmptyComponentProperty(bool isDisplayEmpty)
|
||||
public static void DrawEmptyComponentProperty(SerializedProperty property, string name, bool isDisplayEmpty)
|
||||
{
|
||||
|
||||
EcsGUI.DrawEmptyComponentProperty(GUILayoutUtility.GetRect(UnityEditorUtility.GetLabel(name), EditorStyles.label), property, name, isDisplayEmpty);
|
||||
}
|
||||
public static void DrawEmptyComponentProperty(SerializedProperty property, GUIContent label, bool isDisplayEmpty)
|
||||
{
|
||||
EcsGUI.DrawEmptyComponentProperty(GUILayoutUtility.GetRect(label, EditorStyles.label), property, label, isDisplayEmpty);
|
||||
}
|
||||
public static void DrawWorldBaseInfo(EcsWorld world)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user