First of all decided if you want to create a new EditorWindow, DecoratorDrawer, PropertyDrawer, or Editor. Derive from the appropriate base class: * LayoutEditorWindow * LayoutDecoratorDrawer * LayoutPropertyDrawer * LayoutPropertyEditor Override the onCreateLayout method and set a layout. For example: protected override void onCreateLayout() { Layout = new VBoxLayout(). addItem(new IntSlider( () => CurrentProperty.FindPropertyRelative("damage").intValue, v => CurrentProperty.FindPropertyRelative("damage").intValue = v, 0, 100, "Damage" )). addItem( new ProgressBar( () => CurrentProperty.FindPropertyRelative("damage").intValue / 100.0f, "Damage"). visibleIf(() => !CurrentProperty.FindPropertyRelative("damage").hasMultipleDifferentValues) ). addItem(new IntSlider( () => CurrentProperty.FindPropertyRelative("armor").intValue, v => CurrentProperty.FindPropertyRelative("armor").intValue = v, 0, 100, "Armor" )). addItem( new ProgressBar( () => CurrentProperty.FindPropertyRelative("armor").intValue / 100.0f,"Armor"). visibleIf(() => !CurrentProperty.FindPropertyRelative("armor").hasMultipleDifferentValues) ). border(0, 3, 0, 3); }Layouts are created in a hierarchy. Layouts can contain other layouts or controls. Some controls, such as widgets, may also have their own layout and child controls. A horizontal Splitter for example has a left and right layout. See the examples in the Tests folder for some ideas how to use the layouts. The EnhancedHierarchy and PrefabExplorer are also good examples. |
Unity Assets > Enhanced Editor Controls >