https://github.com/andeart/unitylabs.reorderablelisteditor
Editor that draws all lists/arrays in Unity Inspector as re-orderable by default.
https://github.com/andeart/unitylabs.reorderablelisteditor
inspector serialization unity unity-editor unity3d
Last synced: 3 months ago
JSON representation
Editor that draws all lists/arrays in Unity Inspector as re-orderable by default.
- Host: GitHub
- URL: https://github.com/andeart/unitylabs.reorderablelisteditor
- Owner: andeart
- License: mit
- Created: 2019-01-06T22:55:26.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-08-27T00:24:54.000Z (11 months ago)
- Last Synced: 2025-04-11T03:20:34.484Z (3 months ago)
- Topics: inspector, serialization, unity, unity-editor, unity3d
- Language: C#
- Homepage:
- Size: 6.69 MB
- Stars: 18
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# UnityLabs.ReorderableListEditor
[](https://www.nuget.org/packages/Andeart.ReorderableListEditor) [](https://www.nuget.org/packages/Andeart.ReorderableListEditor)
[](https://github.com/andeart/UnityLabs.ReorderableListEditor/releases/latest) [](https://github.com/andeart/UnityLabs.ReorderableListEditor/releases/latest)Editor that draws all lists/arrays in Unity Inspector as re-orderable by default.

This is inspired by [Valentin Simonov's blog article about reorderable lists](http://va.lent.in/unity-make-your-lists-functional-with-reorderablelist/), with additional tweaks and functionality.
This custom editor overrides Unity's default SerializedProperty drawing for arrays and lists.
The majority of the Editor code in this project is protected/virtual, allowing developers an easy to write custom editors that use/extend this reordering feature.
The above gif is the direct result of writing the following code in a project that includes this lib.```csharp
[Serializable]
public struct MyData
{
[SerializeField]
private string _name;
[SerializeField] [Range (0f, 1f)]
private float _floatInRange;
}public class MainContext : MonoBehaviour
{
[SerializeField]
private int[] _integers;[SerializeField]
private MyData[] _dataObjects;[SerializeField]
private ScriptableObject[] _scriptableObjects;
}
```
Notice the absence of any specialised types or attributes. This also works with public fields that Unity auto-serializes, though I personally prefer to avoid those.## Installation and Usage
- Download the `Andeart.ReorderableListEditor.dll` file from [the NuGet page](https://www.nuget.org/packages/Andeart.ReorderableListEditor), or from [the Github releases page](https://github.com/andeart/UnityLabs.ReorderableListEditor/releases/latest).
- Add this file anywhere in your Unity project. Any sub-directory under Assets will work- **it does not need to be under an Editor folder**.
- Optional: Also drop the `Andeart.ReorderableListEditor.pdb` and `Andeart.ReorderableListEditor.xml` files in the same location if you're interested in debugging.
- All of your serialized/public arrays/lists should be re-orderable by default now. Go build some magic.## Feedback
Please feel free to send merge requests, or drop me a message. Cheers!