// MIT License - Copyright (c) 2025 wallstop
// Full license text: https://github.com/wallstop/unity-helpers/blob/main/LICENSE
namespace WallstopStudios.UnityHelpers.Editor.CustomEditors
{
#if UNITY_EDITOR && ODIN_INSPECTOR
using System.Collections.Generic;
using Sirenix.OdinInspector;
using UnityEditor;
using WallstopStudios.UnityHelpers.Editor.Utils.WButton;
///
/// Custom editor for Odin Inspector's SerializedScriptableObject that adds WButton and WGroup support.
/// This editor takes precedence over Odin's default editor when ODIN_INSPECTOR is defined.
///
[CustomEditor(typeof(SerializedScriptableObject), editorForChildClasses: true)]
[CanEditMultipleObjects]
public sealed class WButtonOdinScriptableObjectInspector : Editor
{
private readonly Dictionary _paginationStates =
new();
private readonly Dictionary _foldoutStates = new();
private readonly Dictionary _groupFoldoutStates = new();
public override void OnInspectorGUI()
{
WButtonOdinInspectorHelper.DrawInspectorGUI(
this,
_paginationStates,
_foldoutStates,
_groupFoldoutStates
);
}
}
#endif
}