$ show arimger/Unity-Editor-Toolbox
This repository is a comprehensive Unity Editor extension framework that enhances the inspector, hierarchy, project, toolbar, and scene view windows through custom attributes, drawers, and serialization types. It provides a modular, settings-driven system where features like custom property drawers (regular and toolbox), conditional visibility, decorators, reorderable lists, inline editors, and reference pickers are toggled via a ScriptableObject asset. The architecture is IMGUI-based and overwrites the default custom editor for all UnityEngine.Objects, meaning it cannot easily coexist with other inspector plugins. The codebase demonstrates high craftsmanship in its drawer hierarchy, value extraction and comparison helpers, caching mechanisms, and scoped state management patterns. However, it relies heavily on reflection to access Unity internal APIs and uses numerous version-specific conditionals, which introduces maintenance risk with Unity updates. The included examples and tests provide a solid demonstration of the framework's capabilities.
The LLM identified 6 files worth highlighting for reuse:
Provides a unified API for extracting values from serialized properties via fields, properties, or methods. Implements a strategy pattern with IValueExtractor implementations and handles mixed-value detection. This component is isolated and can be reused in any Unity editor tool that needs to evaluate dynamic conditions based on property values.
Abstract base class for value comparers with concrete implementations for boolean, float, integer, string, and object types. Supports multiple comparison methods (Equal, Greater, Less, etc.) and is used by conditional attribute drawers. The hierarchy is clean, extensible, and can be extracted for any project requiring flexible value comparison logic.
Generic storage class that caches per-property data using SerializedProperty as key. Provides thread-safe access and automatic cleanup when properties change. This pattern is essential for any custom drawer that needs to maintain state across GUI repaints and can be reused independently.
Abstract base class for custom reorderable list implementations. Provides standard background rendering, drag-and-drop reordering, element callbacks, and append/remove functionality. This is a well-encapsulated pattern that can be extended for any list display in Unity editor windows without relying on the built-in ReorderableList.
Allows composing multiple toolbox attributes into a single attribute by implementing the IToolboxArchetype interface. This enables creating compound attributes like TitleAttribute that combine a label, line, and spacing. The pattern is reusable for any attribute-driven system that needs attribute aggregation.
Implements IDisposable to temporarily disable GUI controls within a using block. Restores the previous GUI.enabled state on disposal. This is a textbook example of the scope pattern for safe state management in IMGUI and can be extracted for any Unity editor tool.