{"id":14960396,"url":"https://github.com/dbrizov/naughtyattributes","last_synced_at":"2026-10-18T23:49:29.878Z","repository":{"id":37677557,"uuid":"107134451","full_name":"dbrizov/NaughtyAttributes","owner":"dbrizov","description":"Attribute Extensions for Unity","archived":false,"fork":false,"pushed_at":"2026-09-16T16:24:58.000Z","size":10217,"stargazers_count":5220,"open_issues_count":130,"forks_count":505,"subscribers_count":77,"default_branch":"master","last_synced_at":"2026-10-15T01:24:16.581Z","etag":null,"topics":["attributes","extension","naughty","unity3d","unity3d-editor","unity3d-plugin"],"latest_commit_sha":null,"homepage":"https://unity.naughtyattributes.com/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbrizov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.paypal.com/paypalme/dbrizov","https://www.buymeacoffee.com/dbrizov"]}},"created_at":"2017-10-16T13:54:46.000Z","updated_at":"2026-10-11T10:16:49.000Z","dependencies_parsed_at":"2022-07-08T07:42:48.224Z","dependency_job_id":"13b86cab-adf0-401b-a530-a4e754dea0d7","html_url":"https://github.com/dbrizov/NaughtyAttributes","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/dbrizov/NaughtyAttributes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbrizov%2FNaughtyAttributes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbrizov%2FNaughtyAttributes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbrizov%2FNaughtyAttributes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbrizov%2FNaughtyAttributes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbrizov","download_url":"https://codeload.github.com/dbrizov/NaughtyAttributes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbrizov%2FNaughtyAttributes/sbom","scorecard":{"id":329229,"data":{"date":"2025-08-11","repo":{"name":"github.com/dbrizov/NaughtyAttributes","commit":"a97aa9b3b416e4c9122ea1be1a1b93b1169b0cd3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/dbrizov/NaughtyAttributes/ci.yml/master?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'","Warn: branch protection not enabled for branch 'upm'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-18T03:10:51.095Z","repository_id":37677557,"created_at":"2025-08-18T03:10:51.095Z","updated_at":"2025-08-18T03:10:51.095Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":344872684,"owners_count":38343425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-18T02:00:06.448Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["attributes","extension","naughty","unity3d","unity3d-editor","unity3d-plugin"],"created_at":"2024-09-24T13:22:11.495Z","updated_at":"2026-10-18T23:49:29.865Z","avatar_url":"https://github.com/dbrizov.png","language":"C#","funding_links":["https://www.paypal.com/paypalme/dbrizov","https://www.buymeacoffee.com/dbrizov"],"categories":[],"sub_categories":[],"readme":"# NaughtyAttributes\n[![Unity 2022.3+](https://img.shields.io/badge/unity-2022.3%2B-blue.svg)](https://unity3d.com/get-unity/download)\n[![openupm](https://img.shields.io/npm/v/com.dbrizov.naughtyattributes?label=openupm\u0026registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.dbrizov.naughtyattributes/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://github.com/dbrizov/NaughtyAttributes/blob/master/LICENSE)\n\nNaughtyAttributes is an extension for the Unity Inspector.\n\nIt expands the range of attributes that Unity provides so that you can create powerful inspectors without the need of custom editors or property drawers. It also provides attributes that can be applied to non-serialized fields or functions.\n\nMost of the attributes are implemented using Unity's `CustomPropertyDrawer`, so they will work in your custom editors.\nThe attributes that won't work in your custom editors are the meta attributes and some drawer attributes such as\n`ReorderableList`, `Button`, `ShowNonSerializedField` and `ShowNativeProperty`.\nIf you want all of the attributes to work in your custom editors, however, you must inherit from `NaughtyInspector` and use the `NaughtyEditorGUI.PropertyField_Layout` function instead of `EditorGUILayout.PropertyField`.\n\n**[Documentation](https://unity.naughtyattributes.com/)**\n\n## Installation\n\n\u003e NaughtyAttributes requires **2022.3** or later versions.\n\n1. The package is available on the [openupm registry](https://openupm.com). You can install it via [openupm-cli](https://github.com/openupm/openupm-cli).\n```\nopenupm add com.dbrizov.naughtyattributes\n```\n2. You can also install via git url by adding this entry in your **manifest.json**\n```\n\"com.dbrizov.naughtyattributes\": \"https://github.com/dbrizov/NaughtyAttributes.git#upm\"\n```\n3. You can also download it from the [Asset Store](https://assetstore.unity.com/packages/tools/utilities/naughtyattributes-129996)\n\n# Overview\n\n## Special Attributes\n\n### AllowNesting\nThis attribute must be used in some cases when you want meta attributes to work inside serializable nested structs or classes.\nYou can check in which cases you need to use it [here](https://naughtyattributes.com/attributes/special_attributes/allow_nesting.html).\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n    public MyStruct myStruct;\n}\n\n[System.Serializable]\npublic struct MyStruct\n{\n    public bool enableFlag;\n\n    [EnableIf(\"enableFlag\")]\n    [AllowNesting] // Because it's nested we need to explicitly allow nesting\n    public int integer;\n}\n```\n\n## Drawer Attributes\nProvide special draw options to serialized fields.\nA field can have only one DrawerAttribute. If a field has more than one, only the bottom one will be used.\n\n### AnimatorParam\nSelect an Animator paramater via dropdown interface.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\tpublic Animator someAnimator;\n\n\t[AnimatorParam(\"someAnimator\")]\n\tpublic int paramHash;\n\n\t[AnimatorParam(\"someAnimator\")]\n\tpublic string paramName;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/AnimatorParam_Inspector.png)\n\n### Button\nA method can be marked as a button. A button appears in the inspector and executes the method if clicked.\nWorks both with instance and static methods.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[Button]\n\tprivate void MethodOne() { }\n\n\t[Button(\"Button Text\")]\n\tprivate void MethodTwo() { }\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/Button_Inspector.png)\n\n### CurveRange\nSet bounds and modify curve color for AnimationCurves\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[CurveRange(-1, -1, 1, 1)]\n\tpublic AnimationCurve curve;\n\n\t[CurveRange(EColor.Orange)]\n\tpublic AnimationCurve curve1;\n\n\t[CurveRange(0, 0, 5, 5, EColor.Red)]\n\tpublic AnimationCurve curve2;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/CurveRange_Inspector.png)\n\n### Dropdown\nProvides an interface for dropdown value selection.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[Dropdown(\"intValues\")]\n\tpublic int intValue;\n\n\t[Dropdown(\"StringValues\")]\n\tpublic string stringValue;\n\n\t[Dropdown(\"GetVectorValues\")]\n\tpublic Vector3 vectorValue;\n\n\tprivate int[] intValues = new int[] { 1, 2, 3, 4, 5 };\n\n\tprivate List\u003cstring\u003e StringValues { get { return new List\u003cstring\u003e() { \"A\", \"B\", \"C\", \"D\", \"E\" }; } }\n\n\tprivate DropdownList\u003cVector3\u003e GetVectorValues()\n\t{\n\t\treturn new DropdownList\u003cVector3\u003e()\n\t\t{\n\t\t\t{ \"Right\",   Vector3.right },\n\t\t\t{ \"Left\",    Vector3.left },\n\t\t\t{ \"Up\",      Vector3.up },\n\t\t\t{ \"Down\",    Vector3.down },\n\t\t\t{ \"Forward\", Vector3.forward },\n\t\t\t{ \"Back\",    Vector3.back }\n\t\t};\n\t}\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/Dropdown_Inspector.gif)\n\n### EnumFlags\nProvides dropdown interface for setting enum flags.\n\n```csharp\npublic enum Direction\n{\n\tNone = 0,\n\tRight = 1 \u003c\u003c 0,\n\tLeft = 1 \u003c\u003c 1,\n\tUp = 1 \u003c\u003c 2,\n\tDown = 1 \u003c\u003c 3\n}\n\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[EnumFlags]\n\tpublic Direction flags;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/EnumFlags_Inspector.png)\n\n### Expandable\nMake scriptable objects expandable.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[Expandable]\n\tpublic ScriptableObject scriptableObject;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/Expandable_Inspector.png)\n\n### HorizontalLine\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[HorizontalLine(color: EColor.Red)]\n\tpublic int red;\n\n\t[HorizontalLine(color: EColor.Green)]\n\tpublic int green;\n\n\t[HorizontalLine(color: EColor.Blue)]\n\tpublic int blue;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/HorizontalLine_Inspector.png)\n\n### InfoBox\nUsed for providing additional information.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[InfoBox(\"This is my int\", EInfoBoxType.Normal)]\n\tpublic int myInt;\n\n\t[InfoBox(\"This is my float\", EInfoBoxType.Warning)]\n\tpublic float myFloat;\n\n\t[InfoBox(\"This is my vector\", EInfoBoxType.Error)]\n\tpublic Vector3 myVector;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/InfoBox_Inspector.png)\n\n### InputAxis\nSelect an input axis via dropdown interface.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[InputAxis]\n\tpublic string inputAxis;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/InputAxis_Inspector.png)\n\n### Layer\nSelect a layer via dropdown interface.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[Layer]\n\tpublic string layerName;\n\n\t[Layer]\n\tpublic int layerIndex;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/Layer_Inspector.png)\n\n### MinMaxSlider\nA double slider. The **min value** is saved to the **X** property, and the **max value** is saved to the **Y** property of a **Vector2** field.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[MinMaxSlider(0.0f, 100.0f)]\n\tpublic Vector2 minMaxSlider;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/MinMaxSlider_Inspector.png)\n\n### ProgressBar\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[ProgressBar(\"Health\", 300, EColor.Red)]\n\tpublic int health = 250;\n\n\t[ProgressBar(\"Mana\", 100, EColor.Blue)]\n\tpublic int mana = 25;\n\n\t[ProgressBar(\"Stamina\", 200, EColor.Green)]\n\tpublic int stamina = 150;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/ProgressBar_Inspector.png)\n\n### ReorderableList\nProvides array type fields with an interface for easy reordering of elements.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[ReorderableList]\n\tpublic int[] intArray;\n\n\t[ReorderableList]\n\tpublic List\u003cfloat\u003e floatArray;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/ReorderableList_Inspector.gif)\n\n### ResizableTextArea\nA resizable text area where you can see the whole text.\nUnlike Unity's **Multiline** and **TextArea** attributes where you can see only 3 rows of a given text, and in order to see it or modify it you have to manually scroll down to the desired row.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[ResizableTextArea]\n\tpublic string resizableTextArea;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/ResizableTextArea_Inspector.gif)\n\n### Scene\nSelect a scene from the build settings via dropdown interface.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[Scene]\n\tpublic string bootScene; // scene name\n\n\t[Scene]\n\tpublic int tutorialScene; // scene index\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/Scene_Inspector.png)\n\n### ShowAssetPreview\nShows the texture preview of a given asset (Sprite, Prefab...).\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[ShowAssetPreview]\n\tpublic Sprite sprite;\n\n\t[ShowAssetPreview(128, 128)]\n\tpublic GameObject prefab;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/ShowAssetPreview_Inspector.png)\n\n### ShowNativeProperty\nShows native C# properties in the inspector.\nAll native properties are displayed at the bottom of the inspector after the non-serialized fields and before the method buttons.\nIt supports only certain types **(bool, int, long, float, double, string, Vector2, Vector3, Vector4, Color, Bounds, Rect, UnityEngine.Object)**.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\tpublic List\u003cTransform\u003e transforms;\n\n\t[ShowNativeProperty]\n\tpublic int TransformsCount =\u003e transforms.Count;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/ShowNativeProperty_Inspector.png)\n\n### ShowNonSerializedField\nShows non-serialized fields in the inspector.\nAll non-serialized fields are displayed at the bottom of the inspector before the method buttons.\nKeep in mind that if you change a non-static non-serialized field in the code - the value in the inspector will be updated after you press **Play** in the editor.\nThere is no such issue with static non-serialized fields because their values are updated at compile time.\nIt supports only certain types **(bool, int, long, float, double, string, Vector2, Vector3, Vector4, Color, Bounds, Rect, UnityEngine.Object)**.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[ShowNonSerializedField]\n\tprivate int myInt = 10;\n\n\t[ShowNonSerializedField]\n\tprivate const float PI = 3.14159f;\n\n\t[ShowNonSerializedField]\n\tprivate static readonly Vector3 CONST_VECTOR = Vector3.one;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/ShowNonSerializedField_Inspector.png)\n\n### SortingLayer\nSelect a sorting layer via dropdown interface.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[SortingLayer]\n\tpublic string layerName;\n\n\t[SortingLayer]\n\tpublic int layerId;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/SortingLayer_Inspector.png)\n\n### Tag\nSelect a tag via dropdown interface.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[Tag]\n\tpublic string tagField;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/Tag_Inspector.png)\n\n## Meta Attributes\nGive the fields meta data. A field can have more than one meta attributes.\n\n### BoxGroup\nSurrounds grouped fields with a box.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[BoxGroup(\"Integers\")]\n\tpublic int firstInt;\n\t[BoxGroup(\"Integers\")]\n\tpublic int secondInt;\n\n\t[BoxGroup(\"Floats\")]\n\tpublic float firstFloat;\n\t[BoxGroup(\"Floats\")]\n\tpublic float secondFloat;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/BoxGroup_Inspector.png)\n\n### Foldout\nMakes a foldout group.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[Foldout(\"Integers\")]\n\tpublic int firstInt;\n\t[Foldout(\"Integers\")]\n\tpublic int secondInt;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/Foldout_Inspector.gif)\n\n### EnableIf / DisableIf\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\tpublic bool enableMyInt;\n\n\t[EnableIf(\"enableMyInt\")]\n\tpublic int myInt;\n\n\t[EnableIf(\"Enabled\")]\n\tpublic float myFloat;\n\n\t[EnableIf(\"NotEnabled\")]\n\tpublic Vector3 myVector;\n\n\tpublic bool Enabled() { return true; }\n\n\tpublic bool NotEnabled =\u003e false;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/EnableIf_Inspector.gif)\n\nYou can have more than one condition.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\tpublic bool flag0;\n\tpublic bool flag1;\n\n\t[EnableIf(EConditionOperator.And, \"flag0\", \"flag1\")]\n\tpublic int enabledIfAll;\n\n\t[EnableIf(EConditionOperator.Or, \"flag0\", \"flag1\")]\n\tpublic int enabledIfAny;\n}\n```\n\n### ShowIf / HideIf\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\tpublic bool showInt;\n\n\t[ShowIf(\"showInt\")]\n\tpublic int myInt;\n\n\t[ShowIf(\"AlwaysShow\")]\n\tpublic float myFloat;\n\n\t[ShowIf(\"NeverShow\")]\n\tpublic Vector3 myVector;\n\n\tpublic bool AlwaysShow() { return true; }\n\n\tpublic bool NeverShow =\u003e false;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/ShowIf_Inspector.gif)\n\nYou can have more than one condition.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\tpublic bool flag0;\n\tpublic bool flag1;\n\n\t[ShowIf(EConditionOperator.And, \"flag0\", \"flag1\")]\n\tpublic int showIfAll;\n\n\t[ShowIf(EConditionOperator.Or, \"flag0\", \"flag1\")]\n\tpublic int showIfAny;\n}\n```\n\n### Label\nOverride default field label.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[Label(\"Short Name\")]\n\tpublic string veryVeryLongName;\n\n\t[Label(\"RGB\")]\n\tpublic Vector3 vectorXYZ;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/Label_Inspector.png)\n\n### OnValueChanged\nDetects a value change and executes a callback.\nKeep in mind that the event is detected only when the value is changed from the inspector.\nIf you want a runtime event, you should probably use an event/delegate and subscribe to it.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[OnValueChanged(\"OnValueChangedCallback\")]\n\tpublic int myInt;\n\n\tprivate void OnValueChangedCallback()\n\t{\n\t\tDebug.Log(myInt);\n\t}\n}\n```\n\n### ReadOnly\nMake a field read only.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[ReadOnly]\n\tpublic Vector3 forwardVector = Vector3.forward;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/ReadOnly_Inspector.png)\n\n## Validator Attributes\nUsed for validating the fields. A field can have infinite number of validator attributes.\n\n### MinValue / MaxValue\nClamps integer and float fields. The MinValue/MaxValue attributes can accept either a constant numeric value (e.g. 0, 1.5f) or the name of another field, property, or a parameterless function that returns a numeric value — use nameof(...) to reference members safely. When a name is provided, the referenced member is evaluated to obtain the min/max value at edit-time/runtime.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[MinValue(0), MaxValue(10)]\n\tpublic int myInt;\n\n\t[MinValue(0.0f)]\n\tpublic float myFloat;\n\n\t[MinValue(\"minFloat\"), MaxValue(\"maxFloat\")]\n\tpublic float myFloatThroughFieldName;\n\n\t[MinValue(nameof(minFloatProperty)), MaxValue(nameof(maxFloatProperty))]\n\tpublic float myFloatThroughPropertyName;\n\n\tprivate float minFloat = -1;\n\tprivate float maxFloat = 1;\n\n\tprivate float minFloatProperty =\u003e minFloat;\n\tprivate float maxFloatProperty =\u003e maxFloat;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/MinValueMaxValue_Inspector.gif)\n\n### Required\nUsed to remind the developer that a given reference type field is required.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n\t[Required]\n\tpublic Transform myTransform;\n\n\t[Required(\"Custom required text\")]\n\tpublic GameObject myGameObject;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/Required_Inspector.png)\n\n### RequiredType\nUsed on game objects or components.\nWhen used on a game object, it checks if the game object has a component of the required type.\nWhen used on a component, it checks if the game object it is attached to has a component of the required type.\n\n```csharp\npublic class NaughtyComponent : MonoBehaviour\n{\n    [RequiredType(typeof(Rigidbody))]\n    public GameObject gameObjectMustHaveRigidbody;\n\n    [RequiredType(typeof(Rigidbody))]\n    public Transform transformMustHaveRigidbody;\n\n    [RequiredType(typeof(IRequiredTypeTestInterface))]\n    public GameObject gameObjectMustHaveInterface;\n\n    [RequiredType(typeof(RequiredTypeTestTestObject))]\n    public GameObject gameObjectMustHaveComponent;\n\n    [RequiredType(showInfoMessageWhenEmpty: false, typeof(IRequiredTypeTestInterface))]\n    public GameObject shouldNotShowInfoMessageWhenEmpty;\n\n    [RequiredType(typeof(IRequiredTypeTestInterface), typeof(IRequiredTypeTestInterface2))]\n    public GameObject gameObjectMustHaveMultipleType;\n\n    [RequiredType(typeof(RequiredTypeTestTestObject))]\n    public RequiredTypeTest componentMustHaveAnotherComponent;\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/RequiredType_Inspector.png)\n\n### ValidateInput\nThe most powerful ValidatorAttribute.\n\n```csharp\npublic class _NaughtyComponent : MonoBehaviour\n{\n\t[ValidateInput(\"IsNotNull\")]\n\tpublic Transform myTransform;\n\n\t[ValidateInput(\"IsGreaterThanZero\", \"myInteger must be greater than zero\")]\n\tpublic int myInt;\n\n\tprivate bool IsNotNull(Transform tr)\n\t{\n\t\treturn tr != null;\n\t}\n\n\tprivate bool IsGreaterThanZero(int value)\n\t{\n\t\treturn value \u003e 0;\n\t}\n}\n```\n\n![inspector](https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Documentation~/ValidateInput_Inspector.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbrizov%2Fnaughtyattributes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbrizov%2Fnaughtyattributes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbrizov%2Fnaughtyattributes/lists"}