# dbrizov/naughtyattributes

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/dbrizov-naughtyattributes).**

5,156 stars · 501 forks · C# · MIT

## Links

- GitHub: https://github.com/dbrizov/NaughtyAttributes
- awesome-repositories: https://awesome-repositories.com/repository/dbrizov-naughtyattributes.md

## Topics

`attributes` `extension` `naughty` `unity3d` `unity3d-editor` `unity3d-plugin`

## Description

NaughtyAttributes is a collection of custom attributes for the Unity Editor inspector that allows for field validation, the exposure of non-serialized properties, and the addition of custom UI controls. It functions as an extension library to customize how fields are drawn and behave within the inspector interface without requiring the author to write custom editor scripts.

The library provides tools for creating interactive elements such as buttons that execute specific methods, as well as specialized input controls like sliders and dropdowns. It enables the display of native properties and non-serialized fields for debugging and monitoring game state in real time.

The toolkit includes capabilities for data validation through mandatory reference checks and numeric value clamping. It also supports field change callbacks and the rendering of asset previews for sprites and prefabs directly within the inspector.

## Tags

### Development Tools & Productivity

- [Unity Editor Extensions](https://awesome-repositories.com/f/development-tools-productivity/game-editor-extensions/unity-editor-extensions.md) — Provides a comprehensive set of attributes to customize how fields appear in the Unity inspector without writing custom editor scripts.
- [Attribute-Driven UI Mapping](https://awesome-repositories.com/f/development-tools-productivity/attribute-driven-ui-mapping.md) — Provides a system where custom attributes define how class fields are visually represented and behave in the Unity inspector.
- [Inspector Data Validation](https://awesome-repositories.com/f/development-tools-productivity/editor-extensions/unity/inspector-data-validation.md) — Implements mandatory reference checks and numeric constraints to prevent game design configuration errors.
- [Inspector Variable Exposure](https://awesome-repositories.com/f/development-tools-productivity/inspector-variable-exposure.md) — Enables marking and exposing non-serialized script variables within the visual property inspector. ([source](https://github.com/dbrizov/naughtyattributes#readme))
- [Inspector Utility Buttons](https://awesome-repositories.com/f/development-tools-productivity/editor-extensions/unity/inspector-utility-buttons.md) — Enables the creation of utility buttons within the inspector to trigger specific methods and automate tasks.

### Data & Databases

- [Field Validation](https://awesome-repositories.com/f/data-databases/field-validation.md) — Implements rules and logic for ensuring data integrity at the field level within the inspector.

### Game Development

- [Component Property Debuggers](https://awesome-repositories.com/f/game-development/component-property-debuggers.md) — Provides a way to expose non-serialized properties and native data directly in the inspector interface.
- [Runtime State Debuggers](https://awesome-repositories.com/f/game-development/runtime-state-debuggers.md) — Exposes non-serialized properties and internal data in the editor to monitor game state in real time.

### Programming Languages & Runtimes

- [Reflection-Based Access](https://awesome-repositories.com/f/programming-languages-runtimes/class-member-access/object-member-access/private-property-access/reflection-based-access.md) — Uses C# reflection to access and modify private or non-serialized class members for editor display.

### Software Engineering & Architecture

- [Field Constraints](https://awesome-repositories.com/f/software-engineering-architecture/runtime-value-validation/required-field-enforcement/field-constraints.md) — Enforces data requirements such as numeric ranges and mandatory reference presence on individual fields. ([source](https://github.com/dbrizov/naughtyattributes#readme))
- [Event-Driven Callbacks](https://awesome-repositories.com/f/software-engineering-architecture/event-driven-callbacks.md) — Implements an event-driven system that executes specified methods when inspector values are modified.

### User Interface & Experience

- [Drawing Logic Overrides](https://awesome-repositories.com/f/user-interface-experience/ui-customization/drawing-logic-overrides.md) — Allows overriding the default inspector drawing logic with specialized rendering for specific attribute types.
- [Customizable Property Fields](https://awesome-repositories.com/f/user-interface-experience/customizable-property-fields.md) — Allows adding specialized drawing options like dropdowns and sliders to inspector fields. ([source](https://github.com/dbrizov/naughtyattributes#readme))
- [Editor UI Control Toolkits](https://awesome-repositories.com/f/user-interface-experience/editor-ui-control-toolkits.md) — Provides specialized input controls like sliders and dropdowns for use within the Unity inspector.
- [Inspector Method Triggers](https://awesome-repositories.com/f/user-interface-experience/inspector-method-triggers.md) — Allows creating buttons in the inspector that execute specific instance or static methods when clicked. ([source](https://github.com/dbrizov/naughtyattributes#readme))
- [Node Change Callbacks](https://awesome-repositories.com/f/user-interface-experience/node-based-ui-components/virtual-node-trees/virtual-node-lifecycle-interception/node-change-validators/node-change-callbacks.md) — Triggers specific functions automatically whenever a field value is modified within the inspector. ([source](https://github.com/dbrizov/naughtyattributes#readme))
- [Value Constraint Utilities](https://awesome-repositories.com/f/user-interface-experience/state-update-logic/state-action-value-updates/value-interceptors/value-constraint-utilities.md) — Provides utilities to clamp numeric inspector values within defined minimum and maximum boundaries.
- [Inspector Layout Injections](https://awesome-repositories.com/f/user-interface-experience/view-hierarchy-injections/inspector-layout-injections.md) — Allows injecting buttons and labels directly into the inspector layout based on the presence of attributes.

### Part of an Awesome List

- [Code Attributes](https://awesome-repositories.com/f/awesome-lists/devtools/code-attributes.md) — Provides a suite of useful inspector attributes.
- [Unity Extenders](https://awesome-repositories.com/f/awesome-lists/devtools/unity-extenders.md) — Creates powerful inspectors without needing custom editor scripts.
