{"id":14960396,"url":"https://github.com/dbrizov/naughtyattributes","last_synced_at":"2025-05-14T13:08:59.391Z","repository":{"id":37677557,"uuid":"107134451","full_name":"dbrizov/NaughtyAttributes","owner":"dbrizov","description":"Attribute Extensions for Unity","archived":false,"fork":false,"pushed_at":"2023-11-21T11:38:42.000Z","size":3417,"stargazers_count":4794,"open_issues_count":133,"forks_count":480,"subscribers_count":79,"default_branch":"master","last_synced_at":"2025-04-25T20:39:26.062Z","etag":null,"topics":["attributes","extension","naughty","unity3d","unity3d-editor","unity3d-plugin"],"latest_commit_sha":null,"homepage":"","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},"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":"2025-04-25T09:08:28.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":16,"template":false,"template_full_name":null,"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","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254149976,"owners_count":22022852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2025-05-14T13:08:54.372Z","avatar_url":"https://github.com/dbrizov.png","language":"C#","funding_links":["https://www.paypal.com/paypalme/dbrizov","https://www.buymeacoffee.com/dbrizov","https://paypal.me/dbrizov"],"categories":[],"sub_categories":[],"readme":"# NaughtyAttributes\n[![Unity 2019.4+](https://img.shields.io/badge/unity-2019.4%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## System Requirements\nUnity **2019.4** or later versions. Don't forget to include the NaughtyAttributes namespace.\n\n## Installation\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## Documentation\n- [Documentation](https://dbrizov.github.io/na-docs/)\n- [Documentation Repo](https://github.com/dbrizov/na-docs)\n\n## Support\nNaughtyAttributes is an open-source project that I am developing in my free time. If you like it you can support me by donating.\n\n- [PayPal](https://paypal.me/dbrizov)\n- [Buy Me A Coffee](https://www.buymeacoffee.com/dbrizov)\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://dbrizov.github.io/na-docs/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\t\n\t[CurveRange(EColor.Orange)]\n\tpublic AnimationCurve curve1;\n\t\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.\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```\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### 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"}