diff --git a/Megumin.UnityPackage/Packages/megumin.explosion4unity/Runtime/Scripts/NewClass/Attribute/NewButtonAttribute.cs b/Megumin.UnityPackage/Packages/megumin.explosion4unity/Runtime/Scripts/NewClass/Attribute/NewButtonAttribute.cs index d44e85e..03096c8 100644 --- a/Megumin.UnityPackage/Packages/megumin.explosion4unity/Runtime/Scripts/NewClass/Attribute/NewButtonAttribute.cs +++ b/Megumin.UnityPackage/Packages/megumin.explosion4unity/Runtime/Scripts/NewClass/Attribute/NewButtonAttribute.cs @@ -229,8 +229,16 @@ protected void DrawReference(SerializedProperty property, GUIContent label, Rect SelectedIndex.TryGetValue(indexCacheKey, out var index); var oldSelectedIndex = index; + + var oldIndentLevel = EditorGUI.indentLevel; + EditorGUI.indentLevel = 0; + + ///EditorGUI会自动应用缩进,导致Popup每个层级向右偏移15个单位 + ///这里Popup默认不出来缩进 index = EditorGUI.Popup(popPosition, index, SupportNames); + EditorGUI.indentLevel = oldIndentLevel; + SelectedIndex[indexCacheKey] = index; var targetType = SupportTypes[index];