允许xeric直线布局在名单模式下可选忽略成员

This commit is contained in:
2025-09-22 16:03:38 +08:00
parent ea8058406c
commit 3e570b89a7
3 changed files with 3 additions and 8 deletions
@@ -0,0 +1,50 @@
using UnityEditor;
using UnityEditor.UI;
using UnityEngine;
using XericUI.OverrideLayout;
namespace XericUIEditor.OverrideLayout
{
[CustomEditor(typeof(XericHorizontalOrVerticalLayoutGroup), true)]
[CanEditMultipleObjects]
public class XericHorizontalOrVerticalLayoutGroupEditor : HorizontalOrVerticalLayoutGroupEditor
{
SerializedProperty ignoreInvisible;
SerializedProperty enableListScreening;
SerializedProperty blackListMode;
SerializedProperty whiteList_list;
SerializedProperty blackList_list;
protected override void OnEnable()
{
base.OnEnable();
ignoreInvisible = serializedObject.FindProperty("layoutIgnoreInactive");
enableListScreening = serializedObject.FindProperty("enableListScreening");
blackListMode = serializedObject.FindProperty("blackListMode");
whiteList_list = serializedObject.FindProperty("m_whiteList_list");
blackList_list = serializedObject.FindProperty("m_blackList_list");
}
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
serializedObject.Update();
EditorGUILayout.PropertyField(enableListScreening);
if (enableListScreening.boolValue)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(blackListMode,
EditorGUIUtility.TrTextContent(blackListMode.boolValue ? "Black List Mode" : "White List Mode"));
if (blackListMode.boolValue)
EditorGUILayout.PropertyField(blackList_list, EditorGUIUtility.TrTextContent("Black List"));
else
EditorGUILayout.PropertyField(whiteList_list, EditorGUIUtility.TrTextContent("White List"));
EditorGUI.indentLevel--;
}
EditorGUILayout.PropertyField(ignoreInvisible, true);
serializedObject.ApplyModifiedProperties();
}
}
}