Skip to content

Commit

Permalink
修正引用嵌套时按钮缩进错误
Browse files Browse the repository at this point in the history
  • Loading branch information
KumoKyaku committed Dec 31, 2023
1 parent 0af98f4 commit c755fde
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit c755fde

Please sign in to comment.