All Projects → SubjectNerd-Unity → Reorderableinspector

SubjectNerd-Unity / Reorderableinspector

Licence: mit
Automatic reorderable lists for Unity game engine components

Projects that are alternatives of or similar to Reorderableinspector

Upmgitextension
This package extends the UI of Unity Package Manager (UPM) for the packages installed from git repository.
Stars: ✭ 438 (-3.74%)
Mutual labels:  unity, unity3d
Verticaldissolve
Procedural vertical dissolve shader. Highly customizable. Tweak edge color, noisiness & waviness, rim light, emission scrolling and more.
Stars: ✭ 434 (-4.62%)
Mutual labels:  unity, unity3d
Holoshield
Highly customizable sci-fi shield / force field shader for Unity3D. Allows you to set edge power & color, inner texture scrolling, waviness, scale pulsation and procedural intensity noise. Implements tessellation for low-poly base meshes.
Stars: ✭ 401 (-11.87%)
Mutual labels:  unity, unity3d
Klakndi
NewTek NDI™ plugin for Unity
Stars: ✭ 401 (-11.87%)
Mutual labels:  unity, unity3d
Stablefluids
A straightforward GPU implementation of Jos Stam's "Stable Fluids" on Unity.
Stars: ✭ 430 (-5.49%)
Mutual labels:  unity, unity3d
Kinocontour
Contour line filter for Unity
Stars: ✭ 400 (-12.09%)
Mutual labels:  unity, unity3d
Redrunner
Red Runner, Awesome Platformer Game.
Stars: ✭ 414 (-9.01%)
Mutual labels:  unity, unity3d
Starforce
This is a demo made with Game Framework.
Stars: ✭ 375 (-17.58%)
Mutual labels:  unity, unity3d
Sipsorcery
A WebRTC, SIP and VoIP library for C# and .NET Core. Designed for real-time communications apps.
Stars: ✭ 449 (-1.32%)
Mutual labels:  unity, unity3d
Easybuttons
Add buttons to your inspector in Unity super easily with this simple attribute
Stars: ✭ 410 (-9.89%)
Mutual labels:  unity, unity3d
Enhancer
A collection of utilities to enhance the Unity Editor
Stars: ✭ 394 (-13.41%)
Mutual labels:  unity, unity3d
Actors.unity
🚀Actors is a framework empowering developers to make better games faster on Unity.
Stars: ✭ 437 (-3.96%)
Mutual labels:  unity, unity3d
Lightmap Switching Tool
Tool that allows switching different baked lightmap sets on a unity scene at runtime.
Stars: ✭ 381 (-16.26%)
Mutual labels:  unity, unity3d
Hdrpvatexample
VAT (Vertex Animation Texture) with Unity Shader Graph and Visual Effect Graph
Stars: ✭ 401 (-11.87%)
Mutual labels:  unity, unity3d
Unity Wireframe
General purpose wireframe shaders for use in Unity.
Stars: ✭ 378 (-16.92%)
Mutual labels:  unity, unity3d
Skeletalgeometriceffects
Experiments on geometry shader instancing with skeletal animations
Stars: ✭ 436 (-4.18%)
Mutual labels:  unity, unity3d
Vectorfieldexamples
Unity VFX Graph examples with vector fields
Stars: ✭ 370 (-18.68%)
Mutual labels:  unity, unity3d
Unity2d Components
A constantly evolving array of Unity C# components for 2D games, including classes for pixel art cameras, events & messaging, saving & loading game data, collision handlers, object pools, and more.
Stars: ✭ 375 (-17.58%)
Mutual labels:  unity, unity3d
Networker
A simple to use TCP and UDP networking library for .NET. Compatible with Unity.
Stars: ✭ 408 (-10.33%)
Mutual labels:  unity, unity3d
Miniengineao
SSAO image effect from Microsoft MiniEngine, ported to Unity.
Stars: ✭ 448 (-1.54%)
Mutual labels:  unity, unity3d

Reorderable Inspector

Automatically turn arrays/lists into ReorderableLists in Unity inspectors. Inspired by Alejandro Santiago's implementation.

Sortable Array

This 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.

Installation

Download the UnityPackage from the latest releases and import it into Unity. The directory can be moved after being imported.

Usage

To draw an array as a ReorderableList, mark the property with the Reorderable attribute.

// Add this `using` statement to the top of your file
using SubjectNerd.Utilities;

public class ListReorderTest : MonoBehaviour
{  
	[Reorderable]
	public string[] stringArray; // This will be drawn with a ReorderableList

	public List<string> stringList; // This will be drawn as a default array
}

If you want to apply the reorderable list to all arrays, edit ReorderableArrayInspector.cs and uncomment the defines at the top of the file

Additional Features

ContextMenu buttons.

Quickly add buttons for utility functions to the inspector by using Unity's ContextMenu attribute

public class ContextMenuTest : MonoBehaviour
{
	public bool isTestEnabled;

	[ContextMenu("Test Function")]
	private void MyTestFunction()
	{
		Debug.Log("Test function fired");
	}

	[ContextMenu("Test Function", isValidateFunction:true)]
	private bool TestFunctionValidate()
	{
		return isTestEnabled;
	}

	[ContextMenu("Other Test")]
	private void NonValidatedTest()
	{
		Debug.Log("Non validated test fired");
	}
}

Context Menu

Inline ScriptableObject editing

Edit settings stored in a ScriptableObject in the inspector with the EditScriptable attribute. A feature inspired by Tom Kail's ExtendedScriptableObjectDrawer

public class SkinData : ScriptableObject
{
	public string id;
	public Sprite sprite;
}

public class TestEntity : MonoBehaviour
{
	public string entityName;
	
	// Add the `EditScriptable` attribute to edit the `ScriptableObject` in the GameObject inspector
	[EditScriptable]
	public SkinData skin;
}

Limitations

  • Only supports Unity 5 and above
  • ReorderableLists of class instances may be a little rough, especially below Unity version 5.3
  • Custom inspectors will not automatically gain the ability to turn arrays into reorderable lists. See next section.

Custom inspectors

Custom inspectors will not automatically draw arrays as ReorderableLists unless they inherit from ReorderableArrayInspector.

This class contains helper functions that can handle default property drawing. Below is a template for a custom inspector.

Additional custom inspector functionality is discussed in the wiki.

Inspector Template

[CustomEditor(typeof(YourCustomClass))]
public class CustomSortableInspector : ReorderableArrayInspector
{
	// Called by OnEnable
	protected override void InitInspector()
	{
		base.InitInspector();
		
		// Always call DrawInspector function
		alwaysDrawInspector = true;
		
		// Do other initializations here
	}
	
	// Override this function to draw
	protected override void DrawInspector()
	{
		// Call the relevant default drawer functions here
		// The following functions will automatically draw properties
		// with ReorderableList when applicable
		/*
		// Draw all properties
		DrawPropertiesAll();

		// Like DrawPropertiesExcluding
		DrawPropertiesExcept("sprites");

		// Draw all properties, starting from specified property
		DrawPropertiesFrom("propertyName");

		// Draw all properties until before the specified property
		DrawPropertiesUpTo("endPropertyName");

		// Draw properties starting from startProperty, ends before endProperty
		DrawPropertiesFromUpTo("startProperty", "endProperty");
		*/
		
		// Write your custom inspector functions here
		EditorGUILayout.HelpBox("This is a custom inspector", MessageType.Info);
	}
}

Buy me a coffee!

If this Unity enhancement is useful to you, it would be great if you could buy me a coffee!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].