- Home /
Question by
Vladerx · Apr 27, 2019 at 02:39 AM ·
editor-scriptingeditorgui
How to rearange / set order of a custom editor in the inspector window ?
Is it possible to place a custom component above the transform inspector ?
Comment
Answer by Vladerx · Apr 27, 2019 at 03:03 AM
Found it, but looks like it can be brought up just before the transform inspector. Once the target reaches the 2nd place the function returns false and it stops lifting it up.
public static void MoveToTheTop( MonoBehaviour target )
{
// MonoBehaviour -> Behaviour -> Component
if( ComponentUtility.MoveComponentUp( ( Component ) target ) )
MoveToTheTop( target );
}
Had a look at the following:
Editor/Mono/Inspector/InspectorWindow.cs
Editor/Mono/Inspector/Editor.cs
Editor/Mono/EditorWindow.cs
Editor/Mono/Inspector/EditorDragging.cs
Editor/Mono/ComponentUtility.bindings.cs
Editor/Mono/ComponentUtility.cs
source : https://github.com/Unity-Technologies/UnityCsReference