{"id":13676514,"url":"https://github.com/SubjectNerd-Unity/ReorderableInspector","last_synced_at":"2025-04-29T07:32:34.912Z","repository":{"id":45777481,"uuid":"85203064","full_name":"SubjectNerd-Unity/ReorderableInspector","owner":"SubjectNerd-Unity","description":"Automatic reorderable lists for Unity game engine components","archived":false,"fork":false,"pushed_at":"2020-05-26T01:48:07.000Z","size":212,"stargazers_count":487,"open_issues_count":15,"forks_count":49,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-04-28T15:09:14.418Z","etag":null,"topics":["custom-inspectors","unity","unity3d"],"latest_commit_sha":null,"homepage":null,"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/SubjectNerd-Unity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-16T14:08:53.000Z","updated_at":"2025-04-22T10:38:01.000Z","dependencies_parsed_at":"2022-09-04T18:21:37.212Z","dependency_job_id":null,"html_url":"https://github.com/SubjectNerd-Unity/ReorderableInspector","commit_stats":null,"previous_names":["chemikhazi/reorderableinspector"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SubjectNerd-Unity%2FReorderableInspector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SubjectNerd-Unity%2FReorderableInspector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SubjectNerd-Unity%2FReorderableInspector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SubjectNerd-Unity%2FReorderableInspector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SubjectNerd-Unity","download_url":"https://codeload.github.com/SubjectNerd-Unity/ReorderableInspector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251456022,"owners_count":21592275,"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":["custom-inspectors","unity","unity3d"],"created_at":"2024-08-02T13:00:28.786Z","updated_at":"2025-04-29T07:32:30.645Z","avatar_url":"https://github.com/SubjectNerd-Unity.png","language":"C#","readme":"# Reorderable Inspector\n\nAutomatically turn arrays/lists into ReorderableLists in Unity inspectors. Inspired by [Alejandro Santiago's implementation](https://medium.com/developers-writing/how-about-having-nice-arrays-and-lists-in-unity3d-by-default-e4fba13d1b50).\n\n![Sortable Array](./Docs/sortable-array.png)\n\nThis is an editor enhancement that gives you nicer inspector features without having to write additional code. Easily rearrange arrays, add buttons for utility functions, and and edit linked `ScriptableObjects` right in your GameObject's inspector.\n\n## Installation\n\nDownload the UnityPackage from the [latest releases](https://github.com/ChemiKhazi/ReorderableInspector/releases) and import it into Unity. The directory can be moved after being imported.\n\n## Usage\n\nTo draw an array as a `ReorderableList`, mark the property with the `Reorderable` attribute.\n\n```C#\n// Add this `using` statement to the top of your file\nusing SubjectNerd.Utilities;\n\npublic class ListReorderTest : MonoBehaviour\n{  \n\t[Reorderable]\n\tpublic string[] stringArray; // This will be drawn with a ReorderableList\n\n\tpublic List\u003cstring\u003e stringList; // This will be drawn as a default array\n}\n```\n\nIf you want to apply the reorderable list to all arrays, edit `ReorderableArrayInspector.cs` and uncomment the defines at the top of the file\n\n## Additional Features\n\n### `ContextMenu` buttons.\n\nQuickly add buttons for utility functions to the inspector by using Unity's `ContextMenu` attribute\n\n```C#\npublic class ContextMenuTest : MonoBehaviour\n{\n\tpublic bool isTestEnabled;\n\n\t[ContextMenu(\"Test Function\")]\n\tprivate void MyTestFunction()\n\t{\n\t\tDebug.Log(\"Test function fired\");\n\t}\n\n\t[ContextMenu(\"Test Function\", isValidateFunction:true)]\n\tprivate bool TestFunctionValidate()\n\t{\n\t\treturn isTestEnabled;\n\t}\n\n\t[ContextMenu(\"Other Test\")]\n\tprivate void NonValidatedTest()\n\t{\n\t\tDebug.Log(\"Non validated test fired\");\n\t}\n}\n```\n\n![Context Menu](./Docs/context-menu.png)\n\n### Inline `ScriptableObject` editing\n\nEdit settings stored in a `ScriptableObject` in the inspector with the `EditScriptable` attribute. A feature inspired by [Tom Kail's ExtendedScriptableObjectDrawer](https://heavens-vault-game.tumblr.com/post/162127808290/inline-scriptableobject-editing-in-unity)\n\n```C#\npublic class SkinData : ScriptableObject\n{\n\tpublic string id;\n\tpublic Sprite sprite;\n}\n\npublic class TestEntity : MonoBehaviour\n{\n\tpublic string entityName;\n\t\n\t// Add the `EditScriptable` attribute to edit the `ScriptableObject` in the GameObject inspector\n\t[EditScriptable]\n\tpublic SkinData skin;\n}\n```\n\n## Limitations\n\n- Only supports Unity 5 and above\n- ReorderableLists of class instances may be a little rough, especially below Unity version 5.3\n- Custom inspectors will not automatically gain the ability to turn arrays into reorderable lists. See next section.\n\n## Custom inspectors\n\nCustom inspectors will not automatically draw arrays as ReorderableLists unless they inherit from `ReorderableArrayInspector`.\n\nThis class contains helper functions that can handle default property drawing. Below is a template for a custom inspector.\n\nAdditional custom inspector functionality is [discussed in the wiki](https://github.com/ChemiKhazi/ReorderableInspector/wiki/Custom-Inspectors).\n\n## Inspector Template\n```C#\n[CustomEditor(typeof(YourCustomClass))]\npublic class CustomSortableInspector : ReorderableArrayInspector\n{\n\t// Called by OnEnable\n\tprotected override void InitInspector()\n\t{\n\t\tbase.InitInspector();\n\t\t\n\t\t// Always call DrawInspector function\n\t\talwaysDrawInspector = true;\n\t\t\n\t\t// Do other initializations here\n\t}\n\t\n\t// Override this function to draw\n\tprotected override void DrawInspector()\n\t{\n\t\t// Call the relevant default drawer functions here\n\t\t// The following functions will automatically draw properties\n\t\t// with ReorderableList when applicable\n\t\t/*\n\t\t// Draw all properties\n\t\tDrawPropertiesAll();\n\n\t\t// Like DrawPropertiesExcluding\n\t\tDrawPropertiesExcept(\"sprites\");\n\n\t\t// Draw all properties, starting from specified property\n\t\tDrawPropertiesFrom(\"propertyName\");\n\n\t\t// Draw all properties until before the specified property\n\t\tDrawPropertiesUpTo(\"endPropertyName\");\n\n\t\t// Draw properties starting from startProperty, ends before endProperty\n\t\tDrawPropertiesFromUpTo(\"startProperty\", \"endProperty\");\n\t\t*/\n\t\t\n\t\t// Write your custom inspector functions here\n\t\tEditorGUILayout.HelpBox(\"This is a custom inspector\", MessageType.Info);\n\t}\n}\n```\n\n\n## Buy me a coffee!\n\nIf this Unity enhancement is useful to you, it would be great if you could [buy me a coffee](https://ko-fi.com/subjectnerd)!\n","funding_links":["https://ko-fi.com/subjectnerd)!"],"categories":["Open Source Repositories","C#","Attribute"],"sub_categories":["Editor"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSubjectNerd-Unity%2FReorderableInspector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSubjectNerd-Unity%2FReorderableInspector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSubjectNerd-Unity%2FReorderableInspector/lists"}